Mathlib Class Reference

Mathlib class. More...

#include <mathlib.hpp>


Static Public Member Functions

static void normalize (float *vec)
 Vector-normalization I. Additionally check for non-zero division.
static void compute_unit_vector (float *v)
 Vector-normalization II.
static void compute_cross_prod (float *ret, float *v1, float *v2)
 Vector cross-product.
static void compute_dot_prod (float &ret, float *v1, float *v2)
 Vector dot-product.
static float compute_max (float v1, float v2)
 Compute the maximum of 2 values.
static void compute_rotmat_around_axis (float *rotmat, float *v, float rotangle)
 Compute rotation matrix about an arbitrary axis.
static void compute_vector_matrix_mult_right (float *retv, float *mat, float *v)
 Compute multiplication of a vector with a matrix. retv = M*v so the vector is multiplied from the right Immediately performs the division by the homogeneous component.
static void compute_vector_matrix_mult_left (float *retv, float *mat, float *v)
 Compute multiplication of a vector with a matrix. retv = v*M so the vector is multiplied from the left Immediately performs the division by the homogeneous component.
static float compute_len_2D (float x0, float y0, float x1, float y1)
 Compute the length of a line.


Detailed Description

Mathlib class.

Implements some handy vector- and matrix arithmetic.


Member Function Documentation

static void Mathlib::compute_cross_prod ( float *  ret,
float *  v1,
float *  v2 
) [inline, static]

Vector cross-product.

Parameters:
ret The cross product.
v1 The first vector for the cross-product.
v2 The second vector for the cross-product.

static void Mathlib::compute_dot_prod ( float &  ret,
float *  v1,
float *  v2 
) [inline, static]

Vector dot-product.

Parameters:
ret The dot-product.
v1 The first vector for the dot-product.
v2 The second vector for the dot-product.

static float Mathlib::compute_len_2D ( float  x0,
float  y0,
float  x1,
float  y1 
) [inline, static]

Compute the length of a line.

Parameters:
x0 x-coordinate of the start-point of the line.
y0 y-coordinate of the start-point of the line.
x1 x-coordinate of the end-point of the line.
y1 y-coordinate of the end-point of the line.

static float Mathlib::compute_max ( float  v1,
float  v2 
) [inline, static]

Compute the maximum of 2 values.

Parameters:
v1 The first value.
v2 The second value.

static void Mathlib::compute_rotmat_around_axis ( float *  rotmat,
float *  v,
float  rotangle 
) [inline, static]

Compute rotation matrix about an arbitrary axis.

Parameters:
rotmat Destination for the computed rotation matrix.
v Vector that determines the rotation axis.
rotangle Rotation angle in degrees.

static void Mathlib::compute_unit_vector ( float *  v  )  [inline, static]

Vector-normalization II.

Parameters:
v The vector to normalize.

static void Mathlib::compute_vector_matrix_mult_left ( float *  retv,
float *  mat,
float *  v 
) [inline, static]

Compute multiplication of a vector with a matrix. retv = v*M so the vector is multiplied from the left Immediately performs the division by the homogeneous component.

Parameters:
retv Destination for the result.
mat The matrix.
v The vector.

static void Mathlib::compute_vector_matrix_mult_right ( float *  retv,
float *  mat,
float *  v 
) [inline, static]

Compute multiplication of a vector with a matrix. retv = M*v so the vector is multiplied from the right Immediately performs the division by the homogeneous component.

Parameters:
retv Destination for the result.
mat The matrix.
v The vector.

static void Mathlib::normalize ( float *  vec  )  [inline, static]

Vector-normalization I. Additionally check for non-zero division.

Parameters:
vec The vector to normalize.


The documentation for this class was generated from the following file:
Generated on Tue Jun 26 04:22:56 2007 for YAZAPA - yet another zooming and panning application by  doxygen 1.4.7