LinearAlgebra(3)

πŸ“¦ version 1.0c7, in fedora 43, fedora 44

✨ LinearAlgebra(3) ✨

okay so bestie, welcome to LinearAlgebra(3), straight from the Library Functions Manual. this is the linear algebra routine pack, and it's giving slay math but make it cute. let's get into it. πŸ’–


🌸 NAME 🌸

vpIdentity3, vpIdentity4, vpNormalize3, vpMatrixVectorMult4, vpMatrixMult4, vpCrossProduct, vpSolveSystem4, vpSetVector3, vpSetVector4 β€” linear algebra routines


✨ SYNOPSIS ✨

#include <volpack.h>

void
vpIdentity3(m_dst)
    vpMatrix3 m_dst;

void
vpIdentity4(m_dst)
    vpMatrix4 m_dst;

vpResult
vpNormalize3(v_src1)
    vpVector3 v_src1;

void
vpMatrixVectorMult4(v_dst, m_src1, v_src1)
    vpVector4 v_dst;
    vpMatrix4 m_src1;
    vpVector4 v_src1;

void
vpMatrixMult4(m_dst, m_src1, m_src2)
    vpVector4 m_dst, m_src1, m_src2;

void
vpCrossProduct(v_dst, v_src1, v_src2)
    vpVector3 v_dst, v_src1, v_src2;

vpResult
vpSolveSystem4(m_src1, b, count)
    vpMatrix4 m_src1;
    vpVector4 b[];
    int count;

void
vpSetVector3(v_dst, x, y, z)
    vpVector3 v_dst;
    double x, y, z;

void
vpSetVector4(v_dst, x, y, z, w)
    vpVector4 v_dst;
    double x, y, z, w;

πŸ’… ARGUMENTS πŸ’…

  • m_src1, m_src2, m_dst β€” source and destination matrices. yes, matrices. iconic.
  • v_src1, v_src2, v_dst β€” source and destination vectors. vectors, bestie.
  • b β€” array of right-hand-side vectors.
  • count β€” number of right-hand-side vectors.
  • x, y, z, w β€” vector components.

πŸ¦‹ DESCRIPTION πŸ¦‹

These routines form a simple linear algebra package used internally by VolPack. The routines are also available as utility routines for use by the application.

  • vpIdentity3 β€” assigns the identity matrix to a 3-by-3 matrix. lowkey essential.
  • vpIdentity4 β€” assigns the identity matrix to a 4-by-4 matrix. also iconic.
  • vpNormalize3 β€” normalizes a 3-element vector (so the magnitude is 1.0). The result overwrites the source vector. no cap, it literally replaces it.
  • vpMatrixVectorMult4 β€” multiplies a 4-by-4 matrix by a 4-element column vector and stores the result in the destination vector (v_dst = m . v_src).
  • vpMatrixMult4 β€” multiplies two 4-by-4 matrices and stores the result in the destination matrix (m_dst = m_src1 . m_src2).
  • vpCrossProduct β€” computes the cross product of two 3-element vectors and stores the result in the destination vector (v_dst = v_src1 x v_src2).
  • vpSolveSystem4 β€” solves the linear system m . x = b for each right-hand-side vector in the b array. The solution vectors overwrite the vectors in the b array. The solution is computed using Gauss-Jordan elimination with partial pivoting and implicit scaling.
  • vpSetVector3 β€” initializes the components of a 3-element vector (v_dst = [x, y, z]). It is a macro.
  • vpSetVector4 β€” initializes the components of a 4-element vector (v_dst = [x, y, z, w]). It is a macro.
not me putting macros in the linear algebra section πŸ’… but here we are.

😭 ERRORS 😭

vpNormalize3 and vpSolveSystem4 normally return VP_OK. The following error return value is possible:

  • VPERROR_SINGULAR β€” The vector is a 0 vector (vpNormalize3 only), or the matrix is singular (vpSolveSystem4 only).

πŸ‘‘ SEE ALSO πŸ‘‘

VolPack(3)


source/version: VolPack Β· page: LinearAlgebra(3) Β· date: not listed on this page. stay slay, bestie πŸ’œ

πŸ“¦ where this page comes from