PAL Geometry: Data Layout, Device Conversion, and Matrix Utility

Packing/unpacking helpers, device-coordinate conversion routines, and the explicit 3×3 matrix inversion utility.

PAL Geometry: Data Layout, Device Conversion, and Matrix Utility — 13 functions

KiratPalGeom3DConvDevPos

Signature
void KiratPalGeom3DConvDevPos( T_FLOAT* pfA, T_FLOAT* pfB, T_BOOL bPolarA, T_BOOL bPolarB, T_INT iExp);
Description
Converts position representations between the coordinate conventions used by the geometry module.
Mathematical operation
Cartesian device position \([x,y,z]\) is mapped to \([x,\rho,\alpha]\) with \(\rho=\sqrt{y^2+z^2}\) and \(\alpha=\operatorname{atan2}(z,y)\,180/\pi\); values are additionally scaled by \(10^{iExp}\) in the direction selected by the conversion flag.

KiratPalGeom3DConvDevRot

Signature
void KiratPalGeom3DConvDevRot( T_FLOAT* pfRpy, T_FLOAT* pfPos, T_FLOAT* pfQ, T_BOOL bRelative, enum tKiratPalGeom3DAngleUnit eUnit);
Description
Converts/transforms rotation representations while accounting for position, quaternion, and relative/absolute conventions.
Mathematical operation
The routine converts roll-pitch-yaw to a quaternion \(q_{RPY}\). For relative device positions it additionally composes an x-axis quaternion from the position angle: \(q\leftarrow q_{RPY}\otimes q_x(\alpha_{pos})\).

KiratPalGeom3DInvertMatrix

Signature
T_INT KiratPalGeom3DInvertMatrix(T_FLOAT** ppfA, T_FLOAT** ppfB);
Description
Explicitly inverts a 3×3 matrix.
Mathematical operation
For the 3x3 matrix \(A\), \(A^{-1}=\operatorname{adj}(A)/\det(A)\), using the explicit cofactor formula in the source.

KiratPalGeom3DSet1DElemWith1DFloat

Signature
void KiratPalGeom3DSet1DElemWith1DFloat( T_FLOAT* pfScalar, T_FLOAT** ppfVec, T_INT iIndex, T_INT iSize);
Description
Helper routine for packing, unpacking, or copying arrays of 3D vectors/quaternions.
Mathematical operation
\(e_i.x=x_{3i},\;e_i.y=x_{3i+1},\;e_i.z=x_{3i+2}\) (packing scalar storage into 3-D elements).

KiratPalGeom3DSet1DFloatWith1DElem

Signature
void KiratPalGeom3DSet1DFloatWith1DElem( T_FLOAT** ppfVec, T_FLOAT* pfScalar, T_INT iIndex, T_INT iSize);
Description
Helper routine for packing, unpacking, or copying arrays of 3D vectors/quaternions.
Mathematical operation
\(x_{3i}=e_i.x,\;x_{3i+1}=e_i.y,\;x_{3i+2}=e_i.z\) (unpacking 3-D elements).

KiratPalGeom3DSet1DQuatFrom1DAxis1DAngle

Signature
void KiratPalGeom3DSet1DQuatFrom1DAxis1DAngle( T_FLOAT** ppfVec, T_FLOAT fAngle, T_FLOAT** ppfQuat, T_INT iSize, enum tKiratPalGeom3DAngleUnit eUnit);
Description
Constructs quaternion values from a rotation axis and angle.
Mathematical operation
\(q=\left[\cos(\theta/2),\;\hat{\mathbf u}\sin(\theta/2)\right]\)

KiratPalGeom3DSet1DQuatFrom1DAxisAngle

Signature
void KiratPalGeom3DSet1DQuatFrom1DAxisAngle( T_FLOAT** ppfVec, T_FLOAT fAngle, T_FLOAT** ppfQuat, T_INT iSize, enum tKiratPalGeom3DAngleUnit eUnit);
Description
Constructs quaternion values from a rotation axis and angle.
Mathematical operation
\(q=\left[\cos(\theta/2),\;\hat{\mathbf u}\sin(\theta/2)\right]\)

KiratPalGeom3DSet1DQuatFrom1DRotSeqVec

Signature
void KiratPalGeom3DSet1DQuatFrom1DRotSeqVec( T_FLOAT** ppfVec, T_FLOAT** ppfQuat, T_INT eSeq, T_INT eOrd, T_INT iSize, enum tKiratPalGeom3DAngleUnit eUnit);
Description
Constructs quaternion values from a configurable Euler/Tait-Bryan rotation sequence.
Mathematical operation
\(q=q_{a_1}(\theta_1)\otimes q_{a_2}(\theta_2)\otimes q_{a_3}(\theta_3)\) for the configured rotation-axis sequence.

KiratPalGeom3DSet1DQuatFrom1DRpyVec

Signature
void KiratPalGeom3DSet1DQuatFrom1DRpyVec( T_FLOAT** pfVec, T_FLOAT** ppfQuat, T_INT iSize, enum tKiratPalGeom3DAngleUnit eUnit);
Description
Constructs quaternion values from roll-pitch-yaw angles.
Mathematical operation
\(q=q_z(\psi)\otimes q_y(\theta)\otimes q_x(\phi)\)

KiratPalGeom3DSet1DQuatIndexToQuat

Signature
void KiratPalGeom3DSet1DQuatIndexToQuat(T_FLOAT* pfQuatIn, T_FLOAT** ppfQuatOut, T_INT iIndex);
Description
Helper routine for packing, unpacking, or copying arrays of 3D vectors/quaternions.
Mathematical operation
\(q\leftarrow q_k\) for the requested quaternion index \(k\).

KiratPalGeom3DSet1DRpyVecFrom1DQuat

Signature
void KiratPalGeom3DSet1DRpyVecFrom1DQuat( T_FLOAT** ppfQuat, T_FLOAT** ppfVec, T_INT iSize, enum tKiratPalGeom3DAngleUnit eUnit);
Description
Converts quaternion values to roll-pitch-yaw angles.
Mathematical operation
\(q\mapsto(\phi_{roll},\theta_{pitch},\psi_{yaw})\) using the quaternion-to-RPY equations implemented by the geometry module.

KiratPalGeom3DSet1DVecBFromVecA

Signature
void KiratPalGeom3DSet1DVecBFromVecA( T_FLOAT* pfVecA, T_FLOAT** ppfVecB, T_INT iSizeA, T_INT iSizeB);
Description
Helper routine for packing, unpacking, or copying arrays of 3D vectors/quaternions.
Mathematical operation
\(\mathbf b_i\leftarrow\mathbf a_i\) for the selected source/destination layout.

KiratPalGeom3DSet1DVecFrom1DFloats

Signature
void KiratPalGeom3DSet1DVecFrom1DFloats( T_FLOAT* pfX, T_FLOAT* pfY, T_FLOAT* pfZ, T_FLOAT** ppfVec, T_INT iSize);
Description
Helper routine for packing, unpacking, or copying arrays of 3D vectors/quaternions.
Mathematical operation
\(\mathbf v_i=(x_i,y_i,z_i)\) from the three input scalar arrays.