Biomechanical Joint Model
 Author: Anderson Maciel

geom Namespace Reference


Classes

struct  ARRAY1D
struct  ARRAY2D
void matrix_rotpart (MatriX_t In, MatriX_t Res)
void matrix_mult_opt (const MatriX ma, const MatriX mb, MatriX mc)
void matrix_lerp (const MatriX_t a, const MatriX_t b, LIBGEOM_REAL u, MatriX result)
void matrix_idt_ (MatriX_t matrix)
void matrix_copy (const MatriX_t src, MatriX_t dst)
void matrix_compose (const MR3D_t mr, const VT3D_t vt, MatriX_t matrix)
void matrix_decompose (MR3D_t mr, VT3D_t vt, const MatriX_t matrix)
void matrix_transpose (const MatriX_t a, MatriX_t at)
void matrix_mult_vhom (const MatriX_t a, const VHOM_t u, VHOM_t v)
void matrix_mult_vt3d (const MatriX_t a, const VT3D_t u, VT3D_t v)
void matrix_inverse (const MatriX_t matrix, MatriX_t matrix_inv)
void matrix_inverse_det (MatriX_t res, LIBGEOM_REAL determinant, const MatriX_t source)
LIBGEOM_REAL matrix_cofactor (const MatriX_t matrix, int i, int j)
LIBGEOM_REAL matrix_determinant (const MatriX_t matrix)
void matrix_mult (const MatriX_t ma, const MatriX_t mb, MatriX_t mc)
bool matrix_egalite (const MatriX_t a, const MatriX_t b)
int matrix_attraction_idt (MatriX_t a)
int matrix_proximite (const MatriX_t a, const MatriX_t b, LIBGEOM_REAL seuil_mr, LIBGEOM_REAL seuil_vt)
bool matrix_write (const MatriX_t m, FILE *f)
bool matrix_read (MatriX_t m, FILE *f)
void mr3d_from_angle_seq_xyz (MR3D mx, LIBGEOM_REAL angX, LIBGEOM_REAL angY, LIBGEOM_REAL angZ)
void mr3d_from_angle_seq_yxz (MR3D mx, LIBGEOM_REAL angY, LIBGEOM_REAL angX, LIBGEOM_REAL angZ)
void mr3d_from_two_vectors (const VT3D_t a, const VT3D_t b, MR3D R)
void mr3d_idt_ (MR3D_t mr)
void mr3d_get (const MatriX_t matrix, MR3D_t a)
void mr3d_copy (const MR3D_t src, MR3D_t dst)
void mr3d_load (MatriX_t matrix, const MR3D_t a)
void mr3d_transpose (const MR3D_t a, MR3D_t at)
void mr3d_self_transpose (MR3D_t ma)
void mr3d_perm_circ (MR3D_t a, MR3D_t b)
void mr3d_opposite (MR3D_t a, MR3D_t b)
void mr3d_symtxy (MR3D_t a, MR3D_t b)
void mr3d_scale (const MR3D_t self, LIBGEOM_REAL scalar, MR3D_t res)
void mr3d_sub (const MR3D_t left, const MR3D_t right, MR3D_t res)
void mr3d_add (const MR3D_t left, const MR3D_t right, MR3D_t res)
void mr3d_mult (const MR3D_t a, const MR3D_t b, MR3D_t c)
void mr3d_mult_vt3d (const MR3D_t ma, const VT3D_t vu, VT3D_t vv)
void mr3d_from_axis_angle (MR3D_t mr, const VT3D_t axis)
void mr3d_to_axis_angle (VT3D_t axis, const MR3D_t mr)
double mr3d_axis_angle (const MR3D_t mr)
bool mr3d_egalite (const MR3D_t a, const MR3D_t b, LIBGEOM_REAL seuil_mr=EPSIL_MR3D)
int mr3d_attraction_idt (MR3D_t a, LIBGEOM_REAL seuil_mr)
int mr3d_attraction_ini (MR3D_t a, LIBGEOM_REAL seuil_mr)
void mr3d_conv_xyz_mob (const MR3D_t m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, LIBGEOM_REAL *ang3)
void mr3d_conv_yxz_mob (const MR3D_t m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, LIBGEOM_REAL *ang3)
void mr3d_reorthogonalize (MR3D_t R, int limit)
bool mr3d_write (const MR3D_t self, FILE *f)
bool mr3d_read (MR3D_t self, FILE *f)
bool vt3d_inside_polygon (VT3D point, VT3D *p, int N)
void vt3d_rotate_around_axis_angle (const VT3D axis_angle, const VT3D v_in, VT3D v_out)
void vt3d_lerp (const VT3D p1, const VT3D p2, LIBGEOM_REAL u, VT3D result)
void vt3d_slerp (const VT3D p1, const VT3D p2, LIBGEOM_REAL u, VT3D result)
void vt3d_get (const MatriX_t matrix, VT3D_t v)
void vt3d_load (MatriX_t matrix, const VT3D_t v)
void vt3d_copy (const VT3D_t src, VT3D_t dst)
void vt3d_set_null (VT3D_t v)
bool vt3d_normalize (const VT3D_t u, VT3D_t v)
void vt3d_cross (const VT3D_t u, const VT3D_t v, VT3D_t w)
void vt3d_scale (const VT3D_t scale, const VT3D_t u, VT3D_t v)
LIBGEOM_REAL vt3d_get_dot (const VT3D_t u, const VT3D_t v)
void vt3d_vhom (const VT3D_t vt3d, VHOM_t vhom)
void vhom_vt3d (const VHOM_t vhom, VT3D_t vt3d)
void vt3d_let (LIBGEOM_REAL x, LIBGEOM_REAL y, LIBGEOM_REAL z, VT3D_t w)
void vt3d_add (const VT3D_t u, const VT3D_t v, VT3D_t w)
void vt3d_sub (const VT3D_t u, const VT3D_t v, VT3D_t w)
void vt3d_mult (const VT3D_t u, const VT3D_t v, VT3D_t w)
void vt3d_div (const VT3D_t u, const VT3D_t v, VT3D_t w)
void vt3d_mults (const VT3D_t v, LIBGEOM_REAL s, VT3D_t w)
void vt3d_divs (const VT3D_t v, LIBGEOM_REAL s, VT3D_t w)
void vt3d_neg (const VT3D_t src, VT3D_t dest)
LIBGEOM_REAL vt3d_get_norm (const VT3D_t v)
LIBGEOM_REAL vt3d_get_norm2 (const VT3D_t v)
LIBGEOM_REAL vt3d_get_dist (const VT3D_t u, const VT3D_t v)
LIBGEOM_REAL vt3d_get_distptline (const VT3D_t p, const VT3D_t q, const VT3D_t n)
LIBGEOM_REAL vt3d_get_distptplane (const VT3D_t p, const VT3D_t q, const VT3D_t n)
void vt3d_rotv (const VT3D_t v, LIBGEOM_REAL sa, LIBGEOM_REAL ca, char k, VT3D_t w)
void vt3d_rotvect (const VT3D_t v, const VT3D_t c, VT3D_t k, LIBGEOM_REAL sa, LIBGEOM_REAL ca, VT3D_t w)
bool vt3d_egalite (const VT3D_t a, const VT3D_t b, LIBGEOM_REAL seuil_vt)
int vt3d_attraction_nul (VT3D_t a, LIBGEOM_REAL seuil_vt)
bool vt3d_write (const VT3D_t self, FILE *f)
bool vt3d_read (VT3D_t self, FILE *f)
double * vtn_creation (int n)
void vtn_destr (double *p)
void vtn_nul (double *p, int n)
double vtn_norm (const double *p, int n)
double vtn_anorm (const double *p, int n)
void vtn_copy (const double *psrc, double *pdst, int n)
void vtn_add (const double *p1, const double *p2, double *pdst, int n)
void vtn_sub (const double *p1, const double *p2, double *pdst, int n)
void vtn_mults (const double *psrc, double *pdst, int n, double alpha)
double vtn_dot (const double *p1, const double *p2, int n)
double vtn_inv (const double *p, double *p_inv, int n)
double * matmxn_creation (int lmax, int cmax)
void matmxn_destr (double *p)
void matmxn_nul (double *p, int lmax, int cmax)
void matmxn_idt (double *p, int lmax, int cmax)
void matmxn_copy (const double *a, double *b, int lmax, int cmax)
void matmxn_mult (const double *a, const double *b, double *c, int imax, int jmax, int kmax)
void matmxn_mult_vtn (const double *a, const double *b, double *c, int lmax, int cmax)
void matmxn_write (double *d, int width, int height, FILE *f)
void matmxn_transpose (const double *src, double *dest, int src_width, int src_height)
bool matmxn_pseudo_inverse (double *m, int lmax, int cmax, double *mp)
void matmxn_damped_least_square_inverse (double *j_inv, double *j_mat, int j_width, int j_height, double damping)
void matmxn_svdcmp (double **a, int m, int n, double *w, double **v)
void quat_set (QUATERNION self, LIBGEOM_REAL w, LIBGEOM_REAL x, LIBGEOM_REAL y, LIBGEOM_REAL z)
void quat_set_null (QUATERNION self)
void quat_set_unit (QUATERNION self)
void quat_assign (QUATERNION self, const QUATERNION newQuat)
void quat_copy (const QUATERNION src, QUATERNION dest)
void quat_get_inv (const QUATERNION self, QUATERNION inv)
void quat_get_conj (const QUATERNION self, QUATERNION conj)
LIBGEOM_REAL quat_get_norm (const QUATERNION self)
LIBGEOM_REAL quat_get_distance (const QUATERNION left, const QUATERNION right)
LIBGEOM_REAL quat_get_sdistance (const QUATERNION left, const QUATERNION right)
void quat_neg (QUATERNION self)
void quat_normalize (QUATERNION self)
LIBGEOM_REAL quat_dot (const QUATERNION left, const QUATERNION right)
void quat_pow (const QUATERNION self, LIBGEOM_REAL alpha, QUATERNION result)
void quat_exp (const QUATERNION self, QUATERNION result)
void quat_ln (const QUATERNION self, QUATERNION result)
void quat_mults (const QUATERNION self, LIBGEOM_REAL s, QUATERNION result)
void quat_mult (const QUATERNION left, const QUATERNION right, QUATERNION result)
void quat_sub (const QUATERNION left, const QUATERNION right, QUATERNION result)
void quat_add (const QUATERNION left, const QUATERNION right, QUATERNION result)
void quat_slerp (const QUATERNION left, const QUATERNION right, LIBGEOM_REAL u, QUATERNION result)
void quat_dump (const QUATERNION self)
void quat_from_axis (QUATERNION self, const VT3D axis, LIBGEOM_REAL angle)
void quat_from_axis_angle (QUATERNION q, const VT3D axis_angle)
void quat_to_axis_angle (const QUATERNION quat, VT3D axis)
void quat_from_matrix (const MatriX m, QUATERNION quat)
void quat_from_mr3d (const MR3D m, QUATERNION quat)
void quat_to_matrix (const QUATERNION self, MatriX result)
void quat_to_mr3d (const QUATERNION self, MR3D result)
void quat_from_two_vectors (const VT3D v1, const VT3D v2, QUATERNION q)
void quat_from_swing (QUATERNION q, const LIBGEOM_REAL swing[2])
void quat_from_swing_and_twist (QUATERNION q, const LIBGEOM_REAL swing[2], LIBGEOM_REAL twist)
void quat_to_swing_and_twist (const QUATERNION q, LIBGEOM_REAL swing[2], LIBGEOM_REAL *twist)
ARRAY1Darray1d_creation (int lines)
void array1d_destroy (ARRAY1D *array1d)
void array1d_nul (ARRAY1D *array1d)
double array1d_norm (ARRAY1D *array1d)
double array1d_anorm (ARRAY1D *array1d)
void array1d_copy (ARRAY1D *src, ARRAY1D *dest)
void array1d_add (ARRAY1D *src_left, ARRAY1D *src_right, ARRAY1D *dest)
void array1d_sub (ARRAY1D *src_left, ARRAY1D *src_right, ARRAY1D *dest)
void array1d_mults (ARRAY1D *src, ARRAY1D *dest, double factor)
double array1d_dot (ARRAY1D *src1, ARRAY1D *src2)
double array1d_inv (ARRAY1D *src, ARRAY1D *dest)
void array1d_write (ARRAY1D *a, FILE *file)
ARRAY2Darray2d_creation (int lines, int cols)
void array2d_destroy (ARRAY2D *array2d)
int array2d_same_size (ARRAY2D *a, ARRAY2D *b)
void array2d_nul (ARRAY2D *array2d)
void array2d_idt (ARRAY2D *array2d)
void array2d_copy (ARRAY2D *src, ARRAY2D *dest)
void array2d_mult (ARRAY2D *a, ARRAY2D *b, ARRAY2D *dest)
void array2d_add (ARRAY2D *a, ARRAY2D *b, ARRAY2D *dest)
void array2d_sub (ARRAY2D *a, ARRAY2D *b, ARRAY2D *dest)
void array2d_mult_array1d (ARRAY2D *array2d, ARRAY1D *array1d, ARRAY1D *dest)
void array2d_scale (ARRAY2D *src, float scalar, ARRAY2D *dest)
void array2d_pseudo_inverse (ARRAY2D *src, ARRAY2D *dest)
void array2d_damped_least_square_inverse (ARRAY2D *j_inv, ARRAY2D *j_mat, double damping)
void array2d_compute_LS_and_DLS_inverse (ARRAY2D *LS_inv, ARRAY2D *DLS_inv, ARRAY2D *j_mat, ARRAY1D *task, double damping)
void array2d_write (ARRAY2D *a, FILE *file)
void array2d_set_column (ARRAY2D *array2d, int column, double value)
void array2d_set_line (ARRAY2D *array2d, int line, double value)
void array2d_transpose (ARRAY2D *src, ARRAY2D *dest)
int polynomial_solve_quadric (double c[3], double s[2])
int polynomial_solve_cubic (double c[4], double s[3])
int polynomial_solve_quartic (double c[5], double s[4])

Typedefs

typedef LIBGEOM_REAL MatriX [4][4]
typedef LIBGEOM_REAL MR3D [3][3]
typedef LIBGEOM_REAL VT3D [3]
typedef LIBGEOM_REAL VHOM [4]
typedef MatriX MatriX_t
typedef MR3D MR3D_t
typedef VT3D VT3D_t
typedef VHOM VHOM_t
typedef LIBGEOM_REAL QUATERNION [4]

Enumerations

enum  { ATTRACTION_NULLE = 0, ATTRACTION_COMPLETE = 1, ATTRACTION_PARTIELLE = 2 }
enum  { GEOM_X_INDEX = 0, GEOM_Y_INDEX = 1, GEOM_Z_INDEX = 2, GEOM_W_INDEX = 3 }

Functions

double safe_acos (double f)
double safe_asin (double f)
void matrix_idt_ (MatriX matrix)
void matrix_copy (const MatriX src, MatriX dst)
void matrix_compose (const MR3D mr, const VT3D vt, MatriX matrix)
void matrix_decompose (MR3D mr, VT3D vt, const MatriX matrix)
void matrix_transpose (const MatriX a, MatriX at)
void matrix_mult_vhom (const MatriX a, const VHOM u, VHOM v)
void matrix_mult_vt3d (const MatriX ma, const VT3D vu, VT3D vv)
void matrix_inverse (const MatriX mdir, MatriX minv)
void matrix_inverse_det (MatriX res, LIBGEOM_REAL determinant, const MatriX source)
LIBGEOM_REAL matrix_cofactor (const MatriX matrix, int i, int j)
LIBGEOM_REAL matrix_determinant (const MatriX matrix)
void matrix_mult (const MatriX ma, const MatriX mb, MatriX mc)
bool matrix_egalite (const MatriX a, const MatriX b)
int matrix_attraction_idt (MatriX a)
int matrix_proximite (const MatriX a, const MatriX b, LIBGEOM_REAL seuil_mr, LIBGEOM_REAL seuil_vt)
bool matrix_write (const MatriX m, FILE *f)
bool matrix_read (MatriX m, FILE *f)
void mr3d_idt_ (MR3D mr)
void mr3d_get (const MatriX matrix, MR3D a)
void mr3d_copy (const MR3D src, MR3D dst)
void mr3d_load (MatriX matrix, const MR3D a)
void mr3d_transpose (const MR3D ma, MR3D mat)
void mr3d_self_transpose (MR3D ma)
void mr3d_perm_circ (MR3D a, MR3D b)
void mr3d_opposite (MR3D a, MR3D b)
void mr3d_symtxy (MR3D a, MR3D b)
void mr3d_scale (const MR3D self, LIBGEOM_REAL scalar, MR3D res)
void mr3d_sub (const MR3D left, const MR3D right, MR3D res)
void mr3d_add (const MR3D left, const MR3D right, MR3D res)
void mr3d_mult (const MR3D a, const MR3D b, MR3D c)
void mr3d_mult_vt3d (const MR3D ma, const VT3D vu, VT3D vv)
void mr3d_from_axis_angle (MR3D mr, const VT3D faxis)
void mr3d_to_axis_angle (VT3D axis, const MR3D mr)
double mr3d_axis_angle (const MR3D mr)
bool mr3d_egalite (const MR3D a, const MR3D b, LIBGEOM_REAL seuil_mr)
int mr3d_attraction_idt (MR3D a, LIBGEOM_REAL seuil_mr)
int mr3d_attraction_ini (MR3D a, LIBGEOM_REAL seuil_mr)
void mr3d_conv_xyz_mob (const MR3D m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, LIBGEOM_REAL *ang3)
void mr3d_conv_yxz_mob (const MR3D m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, LIBGEOM_REAL *ang3)
void mr3d_conv_EulerBoulic_zxy (MR3D_t m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, LIBGEOM_REAL *ang3, bool verbose)
void mr3d_conv_EulerBoulic_zyx (MR3D_t m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, LIBGEOM_REAL *ang3, bool verbose)
void mr3d_conv_EulerBoulic_zx (MR3D_t m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, bool verbose)
void mr3d_conv_EulerBoulic_zy (MR3D_t m, LIBGEOM_REAL *ang1, LIBGEOM_REAL *ang2, bool verbose)
void mr3d_conv_EulerBoulic_z (MR3D_t m, LIBGEOM_REAL *ang1, bool verbose)
void mr3d_reorthogonalize (MR3D R, int limit)
bool mr3d_write (const MR3D self, FILE *f)
bool mr3d_read (MR3D self, FILE *f)
void vt3d_get (const MatriX matrix, VT3D v)
void vt3d_load (MatriX matrix, const VT3D v)
void vt3d_vhom (const VT3D vt3d, VHOM vhom)
void vhom_vt3d (const VHOM vhom, VT3D vt3d)
void vt3d_let (LIBGEOM_REAL x, LIBGEOM_REAL y, LIBGEOM_REAL z, VT3D w)
void vt3d_copy (const VT3D src, VT3D dst)
void vt3d_set_null (VT3D dst)
void vt3d_add (const VT3D u, const VT3D v, VT3D w)
void vt3d_sub (const VT3D u, const VT3D v, VT3D w)
void vt3d_mult (const VT3D u, const VT3D v, VT3D w)
void vt3d_div (const VT3D u, const VT3D v, VT3D w)
void vt3d_mults (const VT3D v, LIBGEOM_REAL s, VT3D w)
void vt3d_divs (const VT3D v, LIBGEOM_REAL s, VT3D w)
void vt3d_neg (const VT3D src, VT3D dest)
LIBGEOM_REAL vt3d_get_norm (const VT3D v)
LIBGEOM_REAL vt3d_get_norm2 (const VT3D v)
LIBGEOM_REAL vt3d_get_dist (const VT3D u, const VT3D v)
LIBGEOM_REAL vt3d_get_distptline (const VT3D p, const VT3D q, const VT3D n)
LIBGEOM_REAL vt3d_get_distptplane (const VT3D p, const VT3D q, const VT3D n)
void vt3d_rotv (const VT3D v, LIBGEOM_REAL sa, LIBGEOM_REAL ca, char k, VT3D w)
void vt3d_rotvect (const VT3D v, const VT3D c, VT3D k, LIBGEOM_REAL sa, LIBGEOM_REAL ca, VT3D w)
bool vt3d_normalize (const VT3D u, VT3D v)
void vt3d_cross (const VT3D u, const VT3D v, VT3D w)
void vt3d_scale (const VT3D scale, const VT3D u, VT3D v)
LIBGEOM_REAL vt3d_get_dot (const VT3D u, const VT3D v)
bool vt3d_egalite (const VT3D a, const VT3D b, LIBGEOM_REAL seuil_vt)
int vt3d_attraction_nul (VT3D a, LIBGEOM_REAL seuil_vt)
bool vt3d_write (const VT3D self, FILE *f)
bool vt3d_read (VT3D self, FILE *f)
static void svd_invert (double *target, double *v, double *w, double *J, int width, int height, bool transpose)
void matmxn_compute_LS_and_DLS_inverse (double *LS_inv, double *DLS_inv, double *matrix, int width, int height, double *task, double damping)

Variables

static LIBGEOM_REAL coef [10]
const float EPSIL_MR3D = 0.00001f
const float EPSIL_VT3D = 0.001f


Typedef Documentation

typedef LIBGEOM_REAL geom::MatriX[4][4]
 

A 4x4 matrix. Like "gl.h" MatriX

Definition at line 80 of file geom.h.

typedef MatriX geom::MatriX_t
 

Definition at line 85 of file geom.h.

typedef LIBGEOM_REAL geom::MR3D[3][3]
 

A 3x3 rotation matrix (orthogonal)

Definition at line 81 of file geom.h.

typedef MR3D geom::MR3D_t
 

Definition at line 86 of file geom.h.

typedef LIBGEOM_REAL geom::QUATERNION[4]
 

A quaternion : ((x,y,z), w)

Definition at line 90 of file geom.h.

typedef LIBGEOM_REAL geom::VHOM[4]
 

A 4-components homogeneous vector

Definition at line 83 of file geom.h.

typedef VHOM geom::VHOM_t
 

Definition at line 88 of file geom.h.

typedef LIBGEOM_REAL geom::VT3D[3]
 

A 3-components vector

Definition at line 82 of file geom.h.

typedef VT3D geom::VT3D_t
 

Definition at line 87 of file geom.h.


Enumeration Type Documentation

anonymous enum
 

Enumerator:
ATTRACTION_NULLE 
ATTRACTION_COMPLETE 
ATTRACTION_PARTIELLE 

Definition at line 55 of file geom.h.

anonymous enum
 

Enumerator:
GEOM_X_INDEX 
GEOM_Y_INDEX 
GEOM_Z_INDEX 
GEOM_W_INDEX 

Definition at line 69 of file geom.h.


Function Documentation

void geom::array1d_add ARRAY1D *  src_left,
ARRAY1D *  src_right,
ARRAY1D *  dest
 

Vector addition: dest = src_left + src_right

Definition at line 3956 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_add().

Here is the call graph for this function:

double geom::array1d_anorm ARRAY1D *  array1d  ) 
 

Returns the sum of the absolute values of each entry of the given vector.

Definition at line 3940 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_anorm().

Here is the call graph for this function:

void geom::array1d_copy ARRAY1D *  src,
ARRAY1D *  dest
 

Copies the contennt of the "src" array into the "dest" array.

Definition at line 3946 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_copy().

Here is the call graph for this function:

ARRAY1D * geom::array1d_creation int  lines  ) 
 

Creates an ARRAY1D object describing an 1D array of doubles, with a given number of lines, and returns a pointer to it.

Definition at line 3902 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_creation().

Here is the call graph for this function:

void geom::array1d_destroy ARRAY1D *  array1d  ) 
 

Destroys an ARRAY1D object, thus freeing its memory.

Definition at line 3917 of file geom.cpp.

References geom::ARRAY1D::data, and vtn_destr().

Here is the call graph for this function:

double geom::array1d_dot ARRAY1D *  src1,
ARRAY1D *  src2
 

Returns the dot product of vectors src1 and src2, i.e. src1 * src2

Definition at line 3991 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_dot().

Here is the call graph for this function:

double geom::array1d_inv ARRAY1D *  src,
ARRAY1D *  dest
 

Computes an array "dest" from a given array "src": dest_i = src_i / norm2, where norm2 is the squared norm of src1.

Definition at line 4001 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_inv().

Here is the call graph for this function:

void geom::array1d_mults ARRAY1D *  src,
ARRAY1D *  dest,
double  factor
 

Vector scaling by a given factor: dest = factor * src

Definition at line 3980 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_mults().

Here is the call graph for this function:

double geom::array1d_norm ARRAY1D *  array1d  ) 
 

Returns the Euclidean norm of the given vector.

Definition at line 3934 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_norm().

Here is the call graph for this function:

void geom::array1d_nul ARRAY1D *  array1d  ) 
 

Initializes each entry of an ARRAY1D to zero.

Definition at line 3928 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_nul().

Here is the call graph for this function:

void geom::array1d_sub ARRAY1D *  src_left,
ARRAY1D *  src_right,
ARRAY1D *  dest
 

Vector substraction: dest = src_left - src_right

Definition at line 3968 of file geom.cpp.

References geom::ARRAY1D::data, geom::ARRAY1D::lines, and vtn_sub().

Here is the call graph for this function:

void geom::array1d_write ARRAY1D *  a,
FILE *  file
 

Writes the content of an ARRAY1D object to a given file.

Definition at line 4011 of file geom.cpp.

References AI.

void geom::array2d_add ARRAY2D *  a,
ARRAY2D *  b,
ARRAY2D *  dest
 

Matrix addition: dest = a + b

Remarks:
The size of the three matrices must be the same, otherwis a fatal error will occur.

Definition at line 4095 of file geom.cpp.

References array2d_same_size(), and geom::ARRAY2D::data.

Here is the call graph for this function:

void geom::array2d_compute_LS_and_DLS_inverse ARRAY2D *  LS_inv,
ARRAY2D *  DLS_inv,
ARRAY2D *  j_mat,
ARRAY1D *  task,
double  damping
 

Warning:
Obsolete.

Definition at line 4193 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY1D::data, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_compute_LS_and_DLS_inverse().

Here is the call graph for this function:

void geom::array2d_copy ARRAY2D *  src,
ARRAY2D *  dest
 

Copies the content of the "src" ARRAY2D object into the "dest" ARRAY2D object.

Definition at line 4071 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_copy().

Here is the call graph for this function:

ARRAY2D * geom::array2d_creation int  lines,
int  cols
 

Creates an ARRAY2D object with a given number of lines and columns, and returns a pointer to it.

Definition at line 4024 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_creation().

Referenced by COME_MoleculesCartilage::initializeJacobian().

Here is the call graph for this function:

void geom::array2d_damped_least_square_inverse ARRAY2D *  j_inv,
ARRAY2D *  j_mat,
double  damping
 

Computes the damped pseudo-inverse of a given "j_mat" ARRAY2D, with a given damping factor. The result is stored in the "j_mat" ARRAY2D.

Parameters:
j_inv  output matrix
j_mat  input matrix

Definition at line 4185 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_damped_least_square_inverse().

Here is the call graph for this function:

void geom::array2d_destroy ARRAY2D *  array2d  ) 
 

Desrtoys an ARRAY2D object, and thus frees its memory.

Definition at line 4041 of file geom.cpp.

References geom::ARRAY2D::data, and matmxn_destr().

Here is the call graph for this function:

void geom::array2d_idt ARRAY2D *  array2d  ) 
 

Initializes each (i,j)-th element of the given ARRAY2D according to the following rule: the element is set to one if i == j, and to zero otherwise.

Remarks:
If the ARRAY2D object is square, this is equivalent to an initialization with the identity matrix.

Definition at line 4065 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_idt().

Here is the call graph for this function:

void geom::array2d_mult ARRAY2D *  a,
ARRAY2D *  b,
ARRAY2D *  dest
 

Matrix multiplication: dest = a * b

Remarks:
The size of the three matrices must be compatible, otherwise a fatal error will occur. The compatibility conditions are as follows:
  • The number of columns of "a" must equal the number of rows of "b"
  • The number of rows of "a" must equal the number of rows of "dest"
  • The number of columns of "b" must equal the number of columns of "dest"

Definition at line 4082 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_mult().

Here is the call graph for this function:

void geom::array2d_mult_array1d ARRAY2D *  array2d,
ARRAY1D *  array1d,
ARRAY1D *  dest
 

Multiplication of a matrix by a vector : dest = array2d * array1d

Remarks:
The size of the objects must be compatible, otherwise a fatal error will occur.

Definition at line 4145 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY1D::data, geom::ARRAY2D::data, geom::ARRAY2D::lines, geom::ARRAY1D::lines, and matmxn_mult_vtn().

Here is the call graph for this function:

void geom::array2d_nul ARRAY2D *  array2d  ) 
 

Initializes each element of the given ARRAY2D object to zero.

Definition at line 4059 of file geom.cpp.

References matmxn_nul().

Referenced by COME_MoleculesCartilage::initializeJacobian().

Here is the call graph for this function:

void geom::array2d_pseudo_inverse ARRAY2D *  src,
ARRAY2D *  dest
 

Computes the pseudo-inverse of a given "src" ARRAY2D.

Remarks:
The size of the "dest" matrix must be equal to the size of the transpose of the "src" matrix, otherwise a fatal error will occur.

This function is based on Greville's recursive algorithm.

Definition at line 4174 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_pseudo_inverse().

Here is the call graph for this function:

int geom::array2d_same_size ARRAY2D *  a,
ARRAY2D *  b
 

Returns TRUE if the two given ARRAY2D objects have same size, i.e. same number of rows (lines) and same number of columns.

Definition at line 4052 of file geom.cpp.

References geom::ARRAY2D::cols, and geom::ARRAY2D::lines.

Referenced by array2d_add(), and array2d_sub().

void geom::array2d_scale ARRAY2D *  src,
float  scalar,
ARRAY2D *  dest
 

Multiplies each element of the src array by a given scalar, and stores the result in the "dest" array.

Definition at line 4158 of file geom.cpp.

References AIJ, geom::ARRAY2D::cols, and geom::ARRAY2D::lines.

void geom::array2d_set_column ARRAY2D *  array2d,
int  column,
double  value
 

Initializes all elements of a column of an ARRAY2D object with a given value.

Definition at line 4222 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, and geom::ARRAY2D::lines.

void geom::array2d_set_line ARRAY2D *  array2d,
int  line,
double  value
 

Initializes all elements of a row (line) of an ARRAY2D object with a given value.

Definition at line 4243 of file geom.cpp.

References geom::ARRAY2D::cols, and geom::ARRAY2D::data.

void geom::array2d_sub ARRAY2D *  a,
ARRAY2D *  b,
ARRAY2D *  dest
 

Matrix substraction: dest = a - b

Remarks:
The size of the three matrices must be the same, otherwise a fatal error will occur.

Definition at line 4120 of file geom.cpp.

References array2d_same_size(), and geom::ARRAY2D::data.

Here is the call graph for this function:

void geom::array2d_transpose ARRAY2D *  src,
ARRAY2D *  dest
 

Computes the transpose of a given "src" ARRAY2D object, and stores it into the "dest" object.

Remarks:
The size of "src" object must be equal to the size of the transpose of the "dest" object, otherwise a fatal error will occur.

Definition at line 4264 of file geom.cpp.

References geom::ARRAY2D::cols, geom::ARRAY2D::data, geom::ARRAY2D::lines, and matmxn_transpose().

Here is the call graph for this function:

void geom::array2d_write ARRAY2D *  a,
FILE *  file
 

Writes the content of a given ARARY2D to a file.

Definition at line 4206 of file geom.cpp.

References AIJ.

void geom::matmxn_compute_LS_and_DLS_inverse double *  LS_inv,
double *  DLS_inv,
double *  matrix,
int  width,
int  height,
double *  task,
double  damping
 

Definition at line 3183 of file geom.cpp.

References Jinv(), matmxn_copy(), matmxn_creation(), matmxn_destr(), matmxn_transpose(), svd(), svd_invert(), vtn_copy(), vtn_creation(), vtn_destr(), and vtn_norm().

Referenced by array2d_compute_LS_and_DLS_inverse().

Here is the call graph for this function:

void geom::matmxn_copy const double *  a,
double *  b,
int  lmax,
int  cmax
 

Definition at line 2640 of file geom.cpp.

Referenced by array2d_copy(), matmxn_compute_LS_and_DLS_inverse(), matmxn_mult(), and matmxn_transpose().

double * geom::matmxn_creation int  lmax,
int  cmax
 

Definition at line 2579 of file geom.cpp.

Referenced by array2d_creation(), matmxn_compute_LS_and_DLS_inverse(), matmxn_damped_least_square_inverse(), matmxn_mult(), and matmxn_transpose().

void geom::matmxn_damped_least_square_inverse double *  j_inv,
double *  j_mat,
int  j_width,
int  j_height,
double  damping
 

Definition at line 2854 of file geom.cpp.

References Jinv(), matmxn_creation(), matmxn_destr(), svd(), VIJ, vtn_creation(), and vtn_destr().

Referenced by array2d_damped_least_square_inverse().

Here is the call graph for this function:

void geom::matmxn_destr double *  p  ) 
 

Definition at line 2597 of file geom.cpp.

Referenced by array2d_destroy(), matmxn_compute_LS_and_DLS_inverse(), matmxn_damped_least_square_inverse(), and matmxn_transpose().

void geom::matmxn_idt double *  p,
int  lmax,
int  cmax
 

Definition at line 2619 of file geom.cpp.

References matmxn_nul(), min, and VIJ.

Referenced by array2d_idt().

Here is the call graph for this function:

void geom::matmxn_mult const double *  a,
const double *  b,
double *  c,
int  imax,
int  jmax,
int  kmax
 

Definition at line 2652 of file geom.cpp.

References matmxn_copy(), matmxn_creation(), and VIJ.

Referenced by array2d_mult().

Here is the call graph for this function:

void geom::matmxn_mult_vtn const double *  a,
const double *  b,
double *  c,
int  lmax,
int  cmax
 

Definition at line 2701 of file geom.cpp.

References VIJ, and vtn_creation().

Referenced by array2d_mult_array1d().

Here is the call graph for this function:

void geom::matmxn_nul double *  p,
int  lmax,
int  cmax
 

Definition at line 2603 of file geom.cpp.

Referenced by array2d_nul(), and matmxn_idt().

bool geom::matmxn_pseudo_inverse double *  m,
int  lmax,
int  cmax,
double *  mp
 

Definition at line 2772 of file geom.cpp.

References EPSIL_ZERO, SEUIL_GREV1, VIJ, vtn_anorm(), vtn_creation(), and vtn_inv().

Referenced by array2d_pseudo_inverse().

Here is the call graph for this function:

void geom::matmxn_svdcmp double **  a,
int  m,
int  n,
double *  w,
double **  v
 

Definition at line 2919 of file geom.cpp.

References GEOM_MIN, GEOM_SIGN, MAX, nrerror(), and pythag().

Referenced by svd().

Here is the call graph for this function:

void geom::matmxn_transpose const double *  src,
double *  dest,
int  src_width,
int  src_height
 

Definition at line 2742 of file geom.cpp.

References matmxn_copy(), matmxn_creation(), matmxn_destr(), and VIJ.

Referenced by array2d_transpose(), and matmxn_compute_LS_and_DLS_inverse().

Here is the call graph for this function:

void geom::matmxn_write double *  d,
int  width,
int  height,
FILE *  f
 

Definition at line 2727 of file geom.cpp.

References VIJ.

int geom::matrix_attraction_idt MatriX_t  a  ) 
 

This procedure tries to attract a given matrix to the identity.

Returns:
ATTRACTION_NULLE, ATTRACTION_PARTIELLE, ATTRACTION_TOTALE

int geom::matrix_attraction_idt MatriX  a  ) 
 

Definition at line 750 of file geom.cpp.

References ATTRACTION_COMPLETE, ATTRACTION_NULLE, ATTRACTION_PARTIELLE, EPSIL_MR3D, EPSIL_VT3D, matrix_compose(), matrix_decompose(), mr3d_attraction_idt(), and vt3d_attraction_nul().

Here is the call graph for this function:

LIBGEOM_REAL geom::matrix_cofactor const MatriX_t  matrix,
int  i,
int  j
 

Returns the cofactor of a given matrix at given indices (i,j)

LIBGEOM_REAL geom::matrix_cofactor const MatriX  matrix,
int  i,
int  j
 

Definition at line 488 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, LIBGEOM_REAL, matrix_determinant(), and matrix_idt_().

Referenced by matrix_inverse_det().

Here is the call graph for this function:

void geom::matrix_compose const MR3D_t  mr,
const VT3D_t  vt,
MatriX_t  matrix
 

Builds a 4x4 matrix from given MR3D and VT3D components.

void geom::matrix_compose const MR3D  mr,
const VT3D  vt,
MatriX  matrix
 

perf. optimal (-O2 -g0)

Definition at line 299 of file geom.cpp.

Referenced by matrix_attraction_idt(), and mr3d_to_axis_angle().

void geom::matrix_copy const MatriX_t  src,
MatriX_t  dst
 

Copy the "src" matrix into the "dst" matrix.

void geom::matrix_copy const MatriX  src,
MatriX  dst
 

Definition at line 284 of file geom.cpp.

References LIBGEOM_REAL.

Referenced by matrix_inverse_det(), and matrix_mult().

void geom::matrix_decompose MR3D_t  mr,
VT3D_t  vt,
const MatriX_t  matrix
 

Decompose a given 4x4 matrix into its rotatin (mr) and translation (vt) components.

void geom::matrix_decompose MR3D  mr,
VT3D  vt,
const MatriX  matrix
 

perf. optimal (-O2 -g0)

Definition at line 317 of file geom.cpp.

Referenced by matrix_attraction_idt(), matrix_egalite(), and matrix_proximite().

LIBGEOM_REAL geom::matrix_determinant const MatriX_t  matrix  ) 
 

Computes the determinant of a 4x4 matrix.

LIBGEOM_REAL geom::matrix_determinant const MatriX  matrix  ) 
 

Definition at line 516 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, GEOM_Z_INDEX, and LIBGEOM_REAL.

Referenced by matrix_cofactor().

bool geom::matrix_egalite const MatriX_t  a,
const MatriX_t  b
 

Compares two matrices.

Returns:
Returns TRUE if both matrices are equal, FALSE otherwise.

bool geom::matrix_egalite const MatriX  a,
const MatriX  b
 

Definition at line 733 of file geom.cpp.

References EPSIL_MR3D, EPSIL_VT3D, matrix_decompose(), mr3d_egalite(), and vt3d_egalite().

Here is the call graph for this function:

void geom::matrix_idt_ MatriX_t  matrix  ) 
 

Initializes a matrix with a 4x4 identity matrix.

void geom::matrix_idt_ MatriX  matrix  ) 
 

Definition at line 270 of file geom.cpp.

References LIBGEOM_REAL.

Referenced by matrix_cofactor().

void geom::matrix_inverse const MatriX_t  matrix,
MatriX_t  matrix_inv
 

Computes the inverse of a given matrix.

Warning:
The input matrix is supposed to be affine, i.e. a combination of rotation and translation only.

void geom::matrix_inverse const MatriX  mdir,
MatriX  minv
 

perf. optimal (-O2 -g0)

inline the rot transpose

setup the last column

inline translation = rot * (-translation)

inline the rot self-transpose

last column remain untouched

inline translation = rot * (-translation)

Definition at line 417 of file geom.cpp.

References LIBGEOM_REAL.

void geom::matrix_inverse_det MatriX_t  res,
LIBGEOM_REAL  determinant,
const MatriX_t  source
 

Computes the inverse of a given matrix. Its determinant must be provided.

Warning:
The deteminant must be non-zero (i.e. the matrix must be inversible).

void geom::matrix_inverse_det MatriX  res,
LIBGEOM_REAL  determinant,
const MatriX  source
 

Definition at line 464 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, LIBGEOM_REAL, matrix_cofactor(), and matrix_copy().

Here is the call graph for this function:

void geom::matrix_lerp const MatriX_t  a,
const MatriX_t  b,
LIBGEOM_REAL  u,
MatriX  result
 

Compute interpolation of two matrices, which is a spherical linear interpolation of corresponding quaternions.

Parameters:
a Input matrix
b Input matrix
u interpolation parameter (between 0 and 1)
result Output matrix

Definition at line 802 of file geom.cpp.

References LIBGEOM_REAL, quat_from_matrix(), quat_slerp(), and quat_to_matrix().

Here is the call graph for this function:

void geom::matrix_mult const MatriX_t  ma,
const MatriX_t  mb,
MatriX_t  mc
 

Computes matrix multiplication : mc = ma * mb

void geom::matrix_mult const MatriX  ma,
const MatriX  mb,
MatriX  mc
 

Definition at line 609 of file geom.cpp.

References b, LIBGEOM_REAL, matrix_copy(), and matrix_is_affine.

Here is the call graph for this function:

void geom::matrix_mult_opt const MatriX  ma,
const MatriX  mb,
MatriX  mc
 

perf. optimal (-O2 -g0)

Definition at line 682 of file geom.cpp.

References b, and LIBGEOM_REAL.

void geom::matrix_mult_vhom const MatriX_t  a,
const VHOM_t  u,
VHOM_t  v
 

void geom::matrix_mult_vhom const MatriX  a,
const VHOM  u,
VHOM  v
 

Definition at line 369 of file geom.cpp.

void geom::matrix_mult_vt3d const MatriX_t  a,
const VT3D_t  u,
VT3D_t  v
 

Multiplies a 4x4 matrix by a 3-vector.

Remarks:
The term vector may be confusing since in many graphics libs (e.g. Performer), this operation is rather called point multiplication. If you want a true matrix-vector multiply, extract the 3x3 rotation matrix and use mr3d_mult.
Warning:
The matrix is supposed to be affine (i.e. rotation and translation components).
Parameters:
a The input 4x4 matrix
u The input vector
v The output vector

void geom::matrix_mult_vt3d const MatriX  ma,
const VT3D  vu,
VT3D  vv
 

perf. optimal (-O2 -g0)

perf. optimal (-O2 -g0)

Definition at line 390 of file geom.cpp.

int geom::matrix_proximite const MatriX_t  a,
const MatriX_t  b,
LIBGEOM_REAL  seuil_mr,
LIBGEOM_REAL  seuil_vt
 

???

int geom::matrix_proximite const MatriX  a,
const MatriX  b,
LIBGEOM_REAL  seuil_mr,
LIBGEOM_REAL  seuil_vt
 

Definition at line 779 of file geom.cpp.

References matrix_decompose(), mr3d_egalite(), and vt3d_egalite().

Here is the call graph for this function:

bool geom::matrix_read MatriX_t  m,
FILE *  f
 

Reads a given matrix from a file.

bool geom::matrix_read MatriX  m,
FILE *  f
 

Definition at line 887 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

void geom::matrix_rotpart MatriX_t  In,
MatriX_t  Res
 

Produces a copy of a given matrix, but with null translation component.

Definition at line 351 of file geom.cpp.

void geom::matrix_transpose const MatriX_t  a,
MatriX_t  at
 

Computes the transpose (at) of a given matrix a

void geom::matrix_transpose const MatriX  a,
MatriX  at
 

Definition at line 330 of file geom.cpp.

References LIBGEOM_REAL.

bool geom::matrix_write const MatriX_t  m,
FILE *  f
 

Writes a given matrix to a file.

bool geom::matrix_write const MatriX  m,
FILE *  f
 

Definition at line 836 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, GEOM_Z_INDEX, and LIBGEOM_REAL.

void geom::mr3d_add const MR3D_t  left,
const MR3D_t  right,
MR3D_t  res
 

Matrix addition: res = left + right

void geom::mr3d_add const MR3D  left,
const MR3D  right,
MR3D  res
 

Definition at line 1120 of file geom.cpp.

References GEOM_X_INDEX, and GEOM_Z_INDEX.

Referenced by mr3d_reorthogonalize().

int geom::mr3d_attraction_idt MR3D_t  a,
LIBGEOM_REAL  seuil_mr
 

Attraction towards the identity matrix.

int geom::mr3d_attraction_idt MR3D  a,
LIBGEOM_REAL  seuil_mr
 

Definition at line 1312 of file geom.cpp.

References ATTRACTION_COMPLETE, ATTRACTION_NULLE, and ATTRACTION_PARTIELLE.

Referenced by matrix_attraction_idt().

int geom::mr3d_attraction_ini MR3D_t  a,
LIBGEOM_REAL  seuil_mr
 

???

int geom::mr3d_attraction_ini MR3D  a,
LIBGEOM_REAL  seuil_mr
 

Definition at line 1343 of file geom.cpp.

double geom::mr3d_axis_angle const MR3D_t  mr  ) 
 

Returns the angle of rotation of the given matrix. The result is in the interval [0, PI].

double geom::mr3d_axis_angle const MR3D  mr  ) 
 

Definition at line 1271 of file geom.cpp.

References safe_acos().

Here is the call graph for this function:

void geom::mr3d_conv_EulerBoulic_z MR3D_t  m,
LIBGEOM_REAL *  ang1,
bool  verbose
 

Definition at line 1606 of file geom.cpp.

void geom::mr3d_conv_EulerBoulic_zx MR3D_t  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
bool  verbose
 

Definition at line 1564 of file geom.cpp.

void geom::mr3d_conv_EulerBoulic_zxy MR3D_t  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
LIBGEOM_REAL *  ang3,
bool  verbose
 

Definition at line 1460 of file geom.cpp.

References M_PI_2.

void geom::mr3d_conv_EulerBoulic_zy MR3D_t  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
bool  verbose
 

Definition at line 1585 of file geom.cpp.

void geom::mr3d_conv_EulerBoulic_zyx MR3D_t  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
LIBGEOM_REAL *  ang3,
bool  verbose
 

Definition at line 1514 of file geom.cpp.

References M_PI_2.

void geom::mr3d_conv_xyz_mob const MR3D_t  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
LIBGEOM_REAL *  ang3
 

conversion de la matrice ligne m en trois angles XYZ mobile ang1 et ang3 sont normalises entre + ou - PI, ang2 entre + ou - PI/2

void geom::mr3d_conv_xyz_mob const MR3D  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
LIBGEOM_REAL *  ang3
 

Definition at line 1372 of file geom.cpp.

References M_PI_2.

void geom::mr3d_conv_yxz_mob const MR3D_t  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
LIBGEOM_REAL *  ang3
 

Conversion de la matrice ligne m en trois angles YXZ mobile ang1 et ang3 sont normalises entre + ou - PI, ang2 entre +- PI/2 correspond a la sequence pour l'analyse des mvts en orthopedie.

void geom::mr3d_conv_yxz_mob const MR3D  m,
LIBGEOM_REAL *  ang1,
LIBGEOM_REAL *  ang2,
LIBGEOM_REAL *  ang3
 

Definition at line 1412 of file geom.cpp.

References M_PI_2.

void geom::mr3d_copy const MR3D_t  src,
MR3D_t  dst
 

Copies an MR3D matrix from "src" to "dest".

void geom::mr3d_copy const MR3D  src,
MR3D  dst
 

perf. optimal (-O2 -g0)

Definition at line 950 of file geom.cpp.

bool geom::mr3d_egalite const MR3D_t  a,
const MR3D_t  b,
LIBGEOM_REAL  seuil_mr = EPSIL_MR3D
 

Compares two MR3D matrices, with a given tolerance (seuil_mr). Returns TRUE if the difference between two corresponding elements is always lower than the tolerance.

bool geom::mr3d_egalite const MR3D  a,
const MR3D  b,
LIBGEOM_REAL  seuil_mr
 

Definition at line 1280 of file geom.cpp.

References DEBUG_GEOM.

Referenced by matrix_egalite(), and matrix_proximite().

void geom::mr3d_from_angle_seq_xyz MR3D  mx,
LIBGEOM_REAL  angX,
LIBGEOM_REAL  angY,
LIBGEOM_REAL  angZ
 

Definition at line 1613 of file geom.cpp.

void geom::mr3d_from_angle_seq_yxz MR3D  mx,
LIBGEOM_REAL  angY,
LIBGEOM_REAL  angX,
LIBGEOM_REAL  angZ
 

Definition at line 1644 of file geom.cpp.

void geom::mr3d_from_axis_angle MR3D_t  mr,
const VT3D_t  axis
 

Converts an axis-angle vector representation of orientation into an MR3D matrix.

void geom::mr3d_from_axis_angle MR3D  mr,
const VT3D  faxis
 

Definition at line 1190 of file geom.cpp.

References EPSILON, and mr3d_idt_().

Here is the call graph for this function:

void geom::mr3d_from_two_vectors const VT3D_t  a,
const VT3D_t  b,
MR3D  R
 

Set R to the rotation matrix that transforms vector a into b i.e. b = a.R a and b remain untouched and need not be of unit length

Definition at line 1677 of file geom.cpp.

References EPSIL_BIG_ZERO, mr3d_idt_(), vt3d_cross(), vt3d_get_dot(), vt3d_get_norm(), and vt3d_normalize().

Here is the call graph for this function:

void geom::mr3d_get const MatriX_t  matrix,
MR3D_t  a
 

Copies the rotation component of a given 4x4 matrix into an MR3D matrix.

void geom::mr3d_get const MatriX  matrix,
MR3D  a
 

Definition at line 938 of file geom.cpp.

void geom::mr3d_idt_ MR3D_t  mr  ) 
 

Initializes an MR3D matrix with the identity matrix.

void geom::mr3d_idt_ MR3D  mr  ) 
 

perf. optimal (-O2 -g0)

Definition at line 925 of file geom.cpp.

Referenced by mr3d_from_axis_angle(), mr3d_from_two_vectors(), and mr3d_reorthogonalize().

void geom::mr3d_load MatriX_t  matrix,
const MR3D_t  a
 

Copies an MR3D matrix into the rotation component of a 4x4 matrix.

void geom::mr3d_load MatriX  matrix,
const MR3D  a
 

Definition at line 960 of file geom.cpp.

void geom::mr3d_mult const MR3D_t  a,
const MR3D_t  b,
MR3D_t  c
 

Matrix multiplication: c = a * b

void geom::mr3d_mult const MR3D  a,
const MR3D  b,
MR3D  c
 

Definition at line 1137 of file geom.cpp.

Referenced by mr3d_reorthogonalize().

void geom::mr3d_mult_vt3d const MR3D_t  ma,
const VT3D_t  vu,
VT3D_t  vv
 

Computes matrix-by-vector multiplication: vv = ma * vu

void geom::mr3d_mult_vt3d const MR3D  ma,
const VT3D  vu,
VT3D  vv
 

perf. optimal (-O2 -g0)

perf. optimal (-O2 -g0)

Definition at line 1159 of file geom.cpp.

void geom::mr3d_opposite MR3D_t  a,
MR3D_t  b
 

Like mr3d_perm_circ, but the "z" vector (the third row) is negated as well. The result is stored in the "b" matrix.

void geom::mr3d_opposite MR3D  a,
MR3D  b
 

Definition at line 1033 of file geom.cpp.

void geom::mr3d_perm_circ MR3D_t  a,
MR3D_t  b
 

Circular permutation of the rows. The first row becomes the third row; the second row becomes the first row; the third row becomes the second row. The result is stored into the "b" matrix.

void geom::mr3d_perm_circ MR3D  a,
MR3D  b
 

Definition at line 1011 of file geom.cpp.

bool geom::mr3d_read MR3D_t  self,
FILE *  f
 

Read an MR3D matri

bool geom::mr3d_read MR3D  self,
FILE *  f
 

Definition at line 1839 of file geom.cpp.

References GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

void geom::mr3d_reorthogonalize MR3D_t  R,
int  limit
 

Re-orthogonalize a given MR3D matrix.

Parameters:
limit ???

void geom::mr3d_reorthogonalize MR3D  R,
int  limit
 

Definition at line 1767 of file geom.cpp.

References MAX, mr3d_add(), mr3d_idt_(), mr3d_mult(), mr3d_scale(), mr3d_sub(), mr3d_transpose(), and X.

Here is the call graph for this function:

void geom::mr3d_scale const MR3D_t  self,
LIBGEOM_REAL  scalar,
MR3D_t  res
 

Multiplies each element of the "self" matrix by the given scalar. The result is stored in the "res" matrix.

void geom::mr3d_scale const MR3D  self,
LIBGEOM_REAL  scalar,
MR3D  res
 

Definition at line 1076 of file geom.cpp.

References GEOM_X_INDEX, and GEOM_Z_INDEX.

Referenced by mr3d_reorthogonalize().

void geom::mr3d_self_transpose MR3D_t  ma  ) 
 

Transposes a given MR3D matrix.

void geom::mr3d_self_transpose MR3D  ma  ) 
 

perf. optimal (-O2 -g0)

Definition at line 997 of file geom.cpp.

void geom::mr3d_sub const MR3D_t  left,
const MR3D_t  right,
MR3D_t  res
 

Matrix substraction: res = left - right

void geom::mr3d_sub const MR3D  left,
const MR3D  right,
MR3D  res
 

Definition at line 1098 of file geom.cpp.

References GEOM_X_INDEX, and GEOM_Z_INDEX.

Referenced by mr3d_reorthogonalize().

void geom::mr3d_symtxy MR3D_t  a,
MR3D_t  b
 

Negates the "x" and "y" vectors (the first and second rows). The result is stored in the "b" matrix.

void geom::mr3d_symtxy MR3D  a,
MR3D  b
 

Definition at line 1054 of file geom.cpp.

void geom::mr3d_to_axis_angle VT3D_t  axis,
const MR3D_t  mr
 

Converts a given MR3D to an axis-angle vector representation.

void geom::mr3d_to_axis_angle VT3D  axis,
const MR3D  mr
 

Definition at line 1236 of file geom.cpp.

References EPSILON, matrix_compose(), quat_from_matrix(), and safe_acos().

Here is the call graph for this function:

void geom::mr3d_transpose const MR3D_t  a,
MR3D_t  at
 

Computes the transpose of a given MR3D matrix (a) into at.

void geom::mr3d_transpose const MR3D  ma,
MR3D  mat
 

perf. optimal (-O2 -g0)

perf. optimal (-O2 -g0)

Definition at line 971 of file geom.cpp.

Referenced by mr3d_reorthogonalize().

bool geom::mr3d_write const MR3D_t  self,
FILE *  f
 

Write the MR3D matrix to a file.

bool geom::mr3d_write const MR3D  self,
FILE *  f
 

Definition at line 1801 of file geom.cpp.

References GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

int geom::polynomial_solve_cubic double  c[4],
double  s[3]
 

Definition at line 4317 of file geom.cpp.

References CBRT, IsZero, and M_PI.

Referenced by polynomial_solve_quartic().

int geom::polynomial_solve_quadric double  c[3],
double  s[2]
 

Definition at line 4286 of file geom.cpp.

References IsZero.

Referenced by polynomial_solve_quartic().

int geom::polynomial_solve_quartic double  c[5],
double  s[4]
 

Definition at line 4389 of file geom.cpp.

References IsZero, polynomial_solve_cubic(), and polynomial_solve_quadric().

Here is the call graph for this function:

void geom::quat_add const QUATERNION  left,
const QUATERNION  right,
QUATERNION  result
 

Quaternion addition : result = left + right

Definition at line 3518 of file geom.cpp.

Referenced by quat_slerp().

void geom::quat_assign QUATERNION  self,
QUATERNION  newQuat
 

self = newQuat

Definition at line 3296 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

Referenced by quat_get_sdistance().

void geom::quat_copy const QUATERNION  src,
QUATERNION  dest
 

dest = src

Definition at line 3306 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

Referenced by quat_slerp().

LIBGEOM_REAL geom::quat_dot const QUATERNION  left,
const QUATERNION  right
 

Returns the dot product of two quaternions: left * right

Definition at line 3403 of file geom.cpp.

Referenced by quat_get_distance(), quat_get_inv(), quat_get_sdistance(), and quat_slerp().

void geom::quat_dump const QUATERNION  self  ) 
 

Writes the quaternion to stdout

Definition at line 3569 of file geom.cpp.

void geom::quat_exp const QUATERNION  self,
QUATERNION  result
 

Exponentiate quaternion, assuming LIBGEOM_REAL part 0 (w==0)

Definition at line 3432 of file geom.cpp.

References EPSIL_BIG_ZERO, fcos, fsin, and fsqrt.

void geom::quat_from_axis QUATERNION  self,
const VT3D  axis,
LIBGEOM_REAL  angle
 

given an angle (radians) and an axis: self = (cos(angle/2),sin(angle/2) * axis)

Definition at line 3580 of file geom.cpp.

Referenced by quat_from_axis_angle().

void geom::quat_from_axis_angle QUATERNION  q,
const VT3D  axis_angle
 

Transforms a given axis-angle vector into an equivalent unit quaternion.

Definition at line 3593 of file geom.cpp.

References EPSIL_BIG_ZERO, quat_from_axis(), quat_set(), vt3d_get_norm(), and vt3d_mults().

Referenced by quat_from_swing(), and quat_from_swing_and_twist().

Here is the call graph for this function:

void geom::quat_from_matrix const MatriX  m,
QUATERNION  result
 

Transforms a rotation matrix (4x4) into a unit quaternion.

Definition at line 3643 of file geom.cpp.

Referenced by matrix_lerp(), and mr3d_to_axis_angle().

void geom::quat_from_mr3d const MR3D  m,
QUATERNION  result
 

Transforms a rotation matrix (3x3) into a unit quaternion.

Definition at line 3695 of file geom.cpp.

void geom::quat_from_swing QUATERNION  q,
const LIBGEOM_REAL  swing[2]
 

Converts a swing parametrization into a unit quaternion.

Remarks:
The swing parametrization is described in Grassia's paper (JGT 98).

Definition at line 3837 of file geom.cpp.

References quat_from_axis_angle(), and vt3d_let().

Here is the call graph for this function:

void geom::quat_from_swing_and_twist QUATERNION  q,
const LIBGEOM_REAL  swing[2],
LIBGEOM_REAL  twist
 

Converts a (swing, twist) parametrization into a unit quaternion.

Remarks:
The swing-twist parametrization is described in Grassia's paper (JGT 98).

Definition at line 3849 of file geom.cpp.

References quat_from_axis_angle(), quat_mult(), and vt3d_let().

Here is the call graph for this function:

void geom::quat_from_two_vectors const VT3D  v1,
const VT3D  v2,
QUATERNION  q
 

Computes the unit quaternion that represents the direct rotation that transforms a given vector v1 into another given vector v2.

Definition at line 3813 of file geom.cpp.

References EPSIL_ZERO, quat_set(), vt3d_cross(), and vt3d_get_dot().

Here is the call graph for this function:

void geom::quat_get_conj const QUATERNION  self,
QUATERNION  conj
 

Sets conj to be the conjugate of self.

Remarks:
The conjugate of a unit quaternion represents the opposite rotation (i.e. it is equivalent to a transpose in matrix format).

Definition at line 3329 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

LIBGEOM_REAL geom::quat_get_distance const QUATERNION  left,
const QUATERNION  right
 

Returns the distance between left and right

Definition at line 3349 of file geom.cpp.

References quat_dot(), and quat_sub().

Here is the call graph for this function:

void geom::quat_get_inv const QUATERNION  self,
QUATERNION  inv
 

Sets inv to the inverse of self

Remarks:
The product of a quaternion by its inverse is the unit quaternion.

Definition at line 3316 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, GEOM_Z_INDEX, and quat_dot().

Here is the call graph for this function:

LIBGEOM_REAL geom::quat_get_norm const QUATERNION  self  ) 
 

Returns the norm of quaternion self

Definition at line 3339 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

Referenced by quat_normalize().

LIBGEOM_REAL geom::quat_get_sdistance const QUATERNION  left,
const QUATERNION  right
 

Returns the shortest distance between left and right

Definition at line 3359 of file geom.cpp.

References quat_assign(), quat_dot(), quat_neg(), and quat_sub().

Here is the call graph for this function:

void geom::quat_ln const QUATERNION  self,
QUATERNION  result
 

Take the natural logarithm of a normalized quaternion

Definition at line 3451 of file geom.cpp.

References EPSIL_BIG_ZERO, fatan2, and fsqrt.

void geom::quat_mult const QUATERNION  left,
const QUATERNION  right,
QUATERNION  result
 

Quaternion multiplication : result = left * right

Remarks:
This operation is not commutative : left * right != right * left

Definition at line 3480 of file geom.cpp.

Referenced by quat_from_swing_and_twist().

void geom::quat_mults const QUATERNION  self,
LIBGEOM_REAL  s,
QUATERNION  result
 

Quaternion scaling: result = self * s

Definition at line 3470 of file geom.cpp.

Referenced by quat_slerp().

void geom::quat_neg QUATERNION  self  ) 
 

Negates a quaternion (i.e. negates all its components), to optain its opposite.

Warning:
A unit quaternion and its opposite represent the same orientation.

Definition at line 3378 of file geom.cpp.

Referenced by quat_get_sdistance().

void geom::quat_normalize QUATERNION  self  ) 
 

Normalizes a quaternion (self)

Definition at line 3388 of file geom.cpp.

References EPSIL_BIG_ZERO, and quat_get_norm().

Here is the call graph for this function:

void geom::quat_pow const QUATERNION  self,
LIBGEOM_REAL  alpha,
QUATERNION  result
 

Raise a normalized quaternion to the power alpha

Definition at line 3413 of file geom.cpp.

References EPSIL_BIG_ZERO, fatan2, fcos, fsin, and fsqrt.

void geom::quat_set QUATERNION  self,
LIBGEOM_REAL  w,
LIBGEOM_REAL  x,
LIBGEOM_REAL  y,
LIBGEOM_REAL  z
 

Sets quaternion self to have components w, x, y, z

Remarks:
Note the unusual order or parameters.

Definition at line 3266 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

Referenced by quat_from_axis_angle(), quat_from_two_vectors(), and quat_slerp().

void geom::quat_set_null QUATERNION  self  ) 
 

Sets self to the zero quaternion.

Definition at line 3276 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

void geom::quat_set_unit QUATERNION  self  ) 
 

Sets self to the unit (identity) quaternion

Definition at line 3286 of file geom.cpp.

References GEOM_W_INDEX, GEOM_X_INDEX, GEOM_Y_INDEX, and GEOM_Z_INDEX.

void geom::quat_slerp const QUATERNION  left,
const QUATERNION  right,
LIBGEOM_REAL  u,
QUATERNION  result
 

Spherical linear interpolation between left and right. As u goes from 0 to 1, result goes from left to right.

Definition at line 3528 of file geom.cpp.

References EPSIL_BIG_ZERO, facos, fsin, quat_add(), quat_copy(), quat_dot(), quat_mults(), and quat_set().

Referenced by matrix_lerp().

Here is the call graph for this function:

void geom::quat_sub const QUATERNION  left,
const QUATERNION  right,
QUATERNION  result
 

Quaternion substraction : result = left - right

Definition at line 3508 of file geom.cpp.

Referenced by quat_get_distance(), and quat_get_sdistance().

void geom::quat_to_axis_angle const QUATERNION  q,
VT3D  axis_angle
 

Transforms a given unit quaternion into an equivalent axis-angle vector, whose norm (angle) is included in the interval [0, PI].

Definition at line 3611 of file geom.cpp.

References EPSILON, M_PI, and safe_acos().

Here is the call graph for this function:

void geom::quat_to_matrix const QUATERNION  self,
MatriX  result
 

TM optimisee par factorisation TM

Definition at line 3744 of file geom.cpp.

Referenced by matrix_lerp().

void geom::quat_to_mr3d const QUATERNION  self,
MR3D  result
 

TM optimisee par factorisation TM

Definition at line 3777 of file geom.cpp.

void geom::quat_to_swing_and_twist const QUATERNION  q,
LIBGEOM_REAL  swing[2],
LIBGEOM_REAL *  twist
 

Converts a unit quaternion into a (swing, twist) parametrization.

  • The norm of the swing component is bounded by PI.
  • The twist component is bounded by -2*PI and +2*PI.
Warning:
The swing-twist parametrization possesses a singularity located at a rotation angle of +- PI, due to the swing component.

Definition at line 3867 of file geom.cpp.

double geom::safe_acos double  f  ) 
 

Unlike acos, this function is tolerant to numerical errors near domain boundaries.

Definition at line 253 of file geom.cpp.

References M_PI.

Referenced by mr3d_axis_angle(), mr3d_to_axis_angle(), quat_to_axis_angle(), and vt3d_slerp().

double geom::safe_asin double  f  ) 
 

Unlike asin, this function is tolerant to numerical errors near domain boundaries.

Definition at line 260 of file geom.cpp.

References M_PI_2.

static void geom::svd_invert double *  target,
double *  v,
double *  w,
double *  J,
int  width,
int  height,
bool  transpose
[static]
 

Definition at line 3134 of file geom.cpp.

References LinAlg::transpose(), and VIJ.

Referenced by matmxn_compute_LS_and_DLS_inverse().

Here is the call graph for this function:

void geom::vhom_vt3d const VHOM_t  vhom,
VT3D_t  vt3d
 

Transcripts a given 4-components homogeneous vector (vhom), into a 3-components vector (vt3d).

Deprecated:

void geom::vhom_vt3d const VHOM  vhom,
VT3D  vt3d
 

Definition at line 1910 of file geom.cpp.

void geom::vt3d_add const VT3D_t  u,
const VT3D_t  v,
VT3D_t  w
 

Computes vector addition: w = u + v

void geom::vt3d_add const VT3D  u,
const VT3D  v,
VT3D  w
 

Definition at line 1963 of file geom.cpp.

Referenced by vt3d_lerp(), vt3d_rotate_around_axis_angle(), vt3d_rotvect(), and vt3d_slerp().

int geom::vt3d_attraction_nul VT3D_t  a,
LIBGEOM_REAL  seuil_vt
 

int geom::vt3d_attraction_nul VT3D  a,
LIBGEOM_REAL  seuil_vt
 

Definition at line 2217 of file geom.cpp.

References ATTRACTION_PARTIELLE.

Referenced by matrix_attraction_idt().

void geom::vt3d_copy const VT3D_t  src,
VT3D_t  dst
 

Copies a source (src) vector to a destination (dst) vector.

void geom::vt3d_copy const VT3D  src,
VT3D  dst
 

Definition at line 1937 of file geom.cpp.

Referenced by vt3d_rotate_around_axis_angle().

void geom::vt3d_cross const VT3D_t  u,
const VT3D_t  v,
VT3D_t  w
 

Computes the cross product of two vectors: w = u X v

void geom::vt3d_cross const VT3D  u,
const VT3D  v,
VT3D  w
 

Definition at line 2154 of file geom.cpp.

Referenced by mr3d_from_two_vectors(), quat_from_two_vectors(), vt3d_get_distptline(), and vt3d_rotate_around_axis_angle().

void geom::vt3d_div const VT3D_t  u,
const VT3D_t  v,
VT3D_t  w
 

Vector division, component-wise : w_i = u_i / v_i

void geom::vt3d_div const VT3D  u,
const VT3D  v,
VT3D  w
 

Definition at line 1994 of file geom.cpp.

void geom::vt3d_divs const VT3D_t  v,
LIBGEOM_REAL  s,
VT3D_t  w
 

Vector scaling (division by a scalar s) : w = v / s

void geom::vt3d_divs const VT3D  v,
LIBGEOM_REAL  s,
VT3D  w
 

Definition at line 2014 of file geom.cpp.

bool geom::vt3d_egalite const VT3D_t  a,
const VT3D_t  b,
LIBGEOM_REAL  seuil_vt
 

Tests equality of two VT3D vectors, within a given tolerance (seuil_vt).

Returns:
Returns TRUE if the vectors are considered equal, and FALSE otherwise.

bool geom::vt3d_egalite const VT3D  a,
const VT3D  b,
LIBGEOM_REAL  seuil_vt
 

Definition at line 2190 of file geom.cpp.

References DEBUG_GEOM.

Referenced by matrix_egalite(), and matrix_proximite().

void geom::vt3d_get const MatriX_t  matrix,
VT3D_t  v
 

Gets the translation component of a 4x4 matrix into the "vt" vector.

void geom::vt3d_get const MatriX  matrix,
VT3D  v
 

Definition at line 1876 of file geom.cpp.

LIBGEOM_REAL geom::vt3d_get_dist const VT3D_t  u,
const VT3D_t  v
 

Returns the norm of the vector u-v

LIBGEOM_REAL geom::vt3d_get_dist const VT3D  u,
const VT3D  v
 

Definition at line 2052 of file geom.cpp.

References vt3d_get_norm(), and vt3d_sub().

Here is the call graph for this function:

LIBGEOM_REAL geom::vt3d_get_distptline const VT3D_t  p,
const VT3D_t  q,
const VT3D_t  n
 

Returns the distance between a point p and a line described by a point (q) and a unit direction vector (n).

LIBGEOM_REAL geom::vt3d_get_distptline const VT3D  p,
const VT3D  q,
const VT3D  n
 

Definition at line 2065 of file geom.cpp.

References vt3d_cross(), vt3d_get_norm(), and vt3d_sub().

Here is the call graph for this function:

LIBGEOM_REAL geom::vt3d_get_distptplane const VT3D_t  p,
const VT3D_t  q,
const VT3D_t  n
 

Returns the distance between a point p and a plane described by a point (q) and a unit normal vector to the plane (n).

LIBGEOM_REAL geom::vt3d_get_distptplane const VT3D  p,
const VT3D  q,
const VT3D  n
 

Definition at line 2079 of file geom.cpp.

References vt3d_get_dot(), and vt3d_sub().

Here is the call graph for this function:

LIBGEOM_REAL geom::vt3d_get_dot const VT3D_t  u,
const VT3D_t  v
 

Returns the dot product of the two given vectors.

LIBGEOM_REAL geom::vt3d_get_dot const VT3D  u,
const VT3D  v
 

Definition at line 2182 of file geom.cpp.

Referenced by mr3d_from_two_vectors(), quat_from_two_vectors(), vt3d_get_distptplane(), vt3d_rotate_around_axis_angle(), vt3d_rotvect(), and vt3d_slerp().

LIBGEOM_REAL geom::vt3d_get_norm const VT3D_t  v  ) 
 

Returns the norm of the given vector.

LIBGEOM_REAL geom::vt3d_get_norm const VT3D  v  ) 
 

Definition at line 2036 of file geom.cpp.

Referenced by mr3d_from_two_vectors(), quat_from_axis_angle(), vt3d_get_dist(), vt3d_get_distptline(), and vt3d_rotate_around_axis_angle().

LIBGEOM_REAL geom::vt3d_get_norm2 const VT3D_t  v  ) 
 

Returns the squared norm of the given vector v, i.e. the dot product of v by itself.

LIBGEOM_REAL geom::vt3d_get_norm2 const VT3D  v  ) 
 

Definition at line 2044 of file geom.cpp.

bool geom::vt3d_inside_polygon VT3D  point,
VT3D p,
int  N
 

Test for point inclusion inside a 2D polygon, non necessarily convex, and lying in the X-Y plane.

Parameters:
point The point to be tested. Only (x,y) components are considered.
p A pointer to an array of points, which are the vertices of the polygon.
N The number of vertices of the polygon.
Returns:
TRUE if the point is inside the polygon, FALSE otherwise.
Warning:
The vertices must be ordered in a clock-wise way.

Definition at line 2246 of file geom.cpp.

void geom::vt3d_lerp const VT3D  p1,
const VT3D  p2,
LIBGEOM_REAL  u,
VT3D  result
 

Linear interpolation between two 3D vectors.

Parameters:
u The interpolation factor between 0. and 1.
Returns:
The result ranges from p1 (when u=0) to p2 (when u=1)

Definition at line 2306 of file geom.cpp.

References vt3d_add(), and vt3d_mults().

Here is the call graph for this function:

void geom::vt3d_let LIBGEOM_REAL  x,
LIBGEOM_REAL  y,
LIBGEOM_REAL  z,
VT3D_t  w
 

Initializes the three components of a vector (w) with given values x, y and z.

void geom::vt3d_let LIBGEOM_REAL  x,
LIBGEOM_REAL  y,
LIBGEOM_REAL  z,
VT3D  w
 

Definition at line 1921 of file geom.cpp.

Referenced by quat_from_swing(), quat_from_swing_and_twist(), vt3d_rotv(), and vt3d_rotvect().

void geom::vt3d_load MatriX_t  matrix,
const VT3D_t  v
 

Puts a given vector into the translation component of a 4x4 matrix.

void geom::vt3d_load MatriX  matrix,
const VT3D  v
 

Definition at line 1886 of file geom.cpp.

void geom::vt3d_mult const VT3D_t  u,
const VT3D_t  v,
VT3D_t  w
 

Vector multiplication, component-wise : w_i = u_i * v_i

void geom::vt3d_mult const VT3D  u,
const VT3D  v,
VT3D  w
 

Definition at line 1984 of file geom.cpp.

void geom::vt3d_mults const VT3D_t  v,
LIBGEOM_REAL  s,
VT3D_t  w
 

Vector scaling (multiplication by a scalar s) : w = s * v

void geom::vt3d_mults const VT3D  v,
LIBGEOM_REAL  s,
VT3D  w
 

Definition at line 2004 of file geom.cpp.

Referenced by quat_from_axis_angle(), vt3d_lerp(), vt3d_rotate_around_axis_angle(), and vt3d_slerp().

void geom::vt3d_neg const VT3D_t  src,
VT3D_t  dest
 

Vector negation: dest = - src

void geom::vt3d_neg const VT3D  src,
VT3D  dest
 

Definition at line 2026 of file geom.cpp.

bool geom::vt3d_normalize const VT3D_t  u,
VT3D_t  v
 

Computes a normalized vector (v) from a given arbitrary vector u. If the given vector is close to the null vector, the "v" vector is set to zero and FAILURE is returned, otherwise SUCCESS is returned.

bool geom::vt3d_normalize const VT3D  u,
VT3D  v
 

Definition at line 2137 of file geom.cpp.

References EPSIL_ZERO.

Referenced by mr3d_from_two_vectors().

bool geom::vt3d_read VT3D_t  self,
FILE *  f
 

Reads a VT3D vector (self) from a file.

bool geom::vt3d_read VT3D  self,
FILE *  f
 

Definition at line 2380 of file geom.cpp.

void geom::vt3d_rotate_around_axis_angle const VT3D  axis_angle,
const VT3D  v_in,
VT3D  v_out
 

Rotates a given vector (v_in) by an axis-angle vector. The result is stored in the v_out vector. This is based on Rodrigues formula.

Definition at line 2276 of file geom.cpp.

References EPSILON, vt3d_add(), vt3d_copy(), vt3d_cross(), vt3d_get_dot(), vt3d_get_norm(), and vt3d_mults().

Here is the call graph for this function:

void geom::vt3d_rotv const VT3D_t  v,
LIBGEOM_REAL  sa,
LIBGEOM_REAL  ca,
char  k,
VT3D_t  w
 

Rotates a given vector (v) around a special axis (x, y or z) by an angle whose sine and cosine must be provided.

Parameters:
v The vector to be rotated
sa The sine of the rotation angle
ca The cosine of the rotation angle
k A char that indicates which axis is to be used ('x', 'y' or 'z')
w The resulting vector

void geom::vt3d_rotv const VT3D  v,
LIBGEOM_REAL  sa,
LIBGEOM_REAL  ca,
char  k,
VT3D  w
 

Definition at line 2092 of file geom.cpp.

References vt3d_let().

Here is the call graph for this function:

void geom::vt3d_rotvect const VT3D_t  v,
const VT3D_t  c,
VT3D_t  k,
LIBGEOM_REAL  sa,
LIBGEOM_REAL  ca,
VT3D_t  w
 

Rotate v around k passing by point c by angle A radians, whose sine (sa) and cosine (ca) must be provided.

void geom::vt3d_rotvect const VT3D  v,
const VT3D  c,
VT3D  k,
LIBGEOM_REAL  sa,
LIBGEOM_REAL  ca,
VT3D  w
 

Definition at line 2113 of file geom.cpp.

References r1(), vt3d_add(), vt3d_get_dot(), vt3d_let(), and vt3d_sub().

Here is the call graph for this function:

void geom::vt3d_scale const VT3D_t  scale,
const VT3D_t  u,
VT3D_t  v
 

Scales a given vector: v = scale * u

void geom::vt3d_scale const VT3D  scale,
const VT3D  u,
VT3D  v
 

Definition at line 2170 of file geom.cpp.

void geom::vt3d_set_null VT3D_t  v  ) 
 

Set to zero the three elements of the given vector.

void geom::vt3d_set_null VT3D  dst  ) 
 

Definition at line 1953 of file geom.cpp.

void geom::vt3d_slerp const VT3D  p1,
const VT3D  p2,
LIBGEOM_REAL  u,
VT3D  result
 

Spherical linear interpolation between two unit 3D vectors. The result is also a unit norm vector.

Parameters:
u The interpolation factor between 0. and 1.
Returns:
The result ranges from p1 (when u=0) to p2 (when u=1)
Remarks:
This is a sub-case of the 4D version for quaternions (see quat_slerp()).

Definition at line 2318 of file geom.cpp.

References EPSIL_BIG_ZERO, safe_acos(), vt3d_add(), vt3d_get_dot(), and vt3d_mults().

Here is the call graph for this function:

void geom::vt3d_sub const VT3D_t  u,
const VT3D_t  v,
VT3D_t  w
 

Computes vector substraction: w = u - v

void geom::vt3d_sub const VT3D  u,
const VT3D  v,
VT3D  w
 

Definition at line 1973 of file geom.cpp.

Referenced by vt3d_get_dist(), vt3d_get_distptline(), vt3d_get_distptplane(), and vt3d_rotvect().

void geom::vt3d_vhom const VT3D_t  vt3d,
VHOM_t  vhom
 

Transcripts a given 3-vector (vt3d) into a 4-components homogeneous vector (vhom), whose fourth component is 1.

Deprecated:

void geom::vt3d_vhom const VT3D  vt3d,
VHOM  vhom
 

Definition at line 1898 of file geom.cpp.

bool geom::vt3d_write const VT3D_t  self,
FILE *  f
 

Writes a VT3D vector (self) to a file.

bool geom::vt3d_write const VT3D  self,
FILE *  f
 

Definition at line 2353 of file geom.cpp.

void geom::vtn_add const double *  p1,
const double *  p2,
double *  pdst,
int  n
 

Definition at line 2484 of file geom.cpp.

Referenced by array1d_add().

double geom::vtn_anorm const double *  p,
int  n
 

Definition at line 2456 of file geom.cpp.

Referenced by array1d_anorm(), and matmxn_pseudo_inverse().

void geom::vtn_copy const double *  psrc,
double *  pdst,
int  n
 

Definition at line 2472 of file geom.cpp.

Referenced by array1d_copy(), and matmxn_compute_LS_and_DLS_inverse().

double * geom::vtn_creation int  n  ) 
 

Definition at line 2406 of file geom.cpp.

Referenced by array1d_creation(), matmxn_compute_LS_and_DLS_inverse(), matmxn_damped_least_square_inverse(), matmxn_mult_vtn(), and matmxn_pseudo_inverse().

void geom::vtn_destr double *  p  ) 
 

Definition at line 2422 of file geom.cpp.

Referenced by array1d_destroy(), matmxn_compute_LS_and_DLS_inverse(), and matmxn_damped_least_square_inverse().

double geom::vtn_dot const double *  p1,
const double *  p2,
int  n
 

Definition at line 2526 of file geom.cpp.

Referenced by array1d_dot().

double geom::vtn_inv const double *  p,
double *  p_inv,
int  n
 

Definition at line 2544 of file geom.cpp.

References EPSIL_ZERO.

Referenced by array1d_inv(), and matmxn_pseudo_inverse().

void geom::vtn_mults const double *  psrc,
double *  pdst,
int  n,
double  alpha
 

Definition at line 2512 of file geom.cpp.

Referenced by array1d_mults().

double geom::vtn_norm const double *  p,
int  n
 

Definition at line 2439 of file geom.cpp.

Referenced by array1d_norm(), and matmxn_compute_LS_and_DLS_inverse().

void geom::vtn_nul double *  p,
int  n
 

Definition at line 2429 of file geom.cpp.

Referenced by array1d_nul().

void geom::vtn_sub const double *  p1,
const double *  p2,
double *  pdst,
int  n
 

Definition at line 2497 of file geom.cpp.

Referenced by array1d_sub().


Variable Documentation

LIBGEOM_REAL geom::coef[10] [static]
 

Initial value:

                        
  { 1., -1./2., 3./8., -5./16., 35./128., -63./256.,
    231./1024., -429./2048., 6435./32768., -12155./65536. }

Definition at line 1763 of file geom.cpp.

const float geom::EPSIL_MR3D = 0.00001f
 

Definition at line 59 of file geom.h.

Referenced by matrix_attraction_idt(), and matrix_egalite().

const float geom::EPSIL_VT3D = 0.001f
 

Definition at line 60 of file geom.h.

Referenced by matrix_attraction_idt(), and matrix_egalite().


Generated on Thu Dec 1 10:14:44 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5