Main Page   Modules   Compound List   File List   Compound Members   File Members  

rotate3D.h File Reference

#include <stdarg.h>
#include <gandalf/linalg/3vector.h>
#include <gandalf/linalg/4vector.h>
#include <gandalf/linalg/3x3matrix.h>
#include <gandalf/linalg/3x4matrix.h>
#include <gandalf/linalg/4x4matrix.h>

Go to the source code of this file.

Compounds

struct  Gan_Quaternion
 Quaternion structure. More...

struct  Gan_Rot3D
 Structure representing 3D rotation. More...

struct  Gan_Rot3D_Cov
 Structure representing covariance of 3D rotation. More...


Typedefs

typedef Gan_Quaternion Gan_Quaternion
 Quaternion structure.

typedef Gan_Rot3D Gan_Rot3D
 Structure representing 3D rotation.

typedef Gan_Rot3D_Cov Gan_Rot3D_Cov
 Structure representing covariance of 3D rotation.


Enumerations

enum  Gan_Rot3D_Type { GAN_ROT3D_QUATERNION, GAN_ROT3D_EXPONENTIAL, GAN_ROT3D_ANGLE_AXIS, GAN_ROT3D_MATRIX }
 Types of rotation handled by Gandalf. More...


Functions

void gan_quat_fill_q (Gan_Quaternion *q, double q0, double q1, double q2, double q3)
 Fill quaternion with values.

Gan_Quaternion gan_quat_fill_s (double q0, double q1, double q2, double q3)
 Fill quaternion with values.

Gan_Quaternion gan_quat_scale_s (Gan_Quaternion *q, double s)
 Multiply all the elements of a quaternion by a scalar value.

Gan_Quaternion gan_quat_divide_s (Gan_Quaternion *q, double s)
 Divide quaternion by scalar.

Gan_Quaternion gan_quat_unit_s (Gan_Quaternion *q)
 Scale quaternion to unit length.

Gan_Quaterniongan_quat_scale_q (Gan_Quaternion *q1, double s, Gan_Quaternion *q2)
 Macro: Scale a quaternion.

Gan_Quaterniongan_quat_scale_i (Gan_Quaternion *q1, double s)
 Macro: Scale a quaternion in-place.

Gan_Quaterniongan_quat_divide_q (Gan_Quaternion *q1, double s, Gan_Quaternion *q2)
 Macro: Divide a quaternion by a scalar.

Gan_Quaterniongan_quat_divide_i (Gan_Quaternion *q1, double s)
 Macro: Divide a quaternion by a scalar in-place.

Gan_Quaterniongan_quat_unit_q (Gan_Quaternion *q1, Gan_Quaternion *q2)
 Macro: Scale a quaternion to unit norm.

Gan_Quaterniongan_quat_unit_i (Gan_Quaternion *q1)
 Macro: Scale a quaternion to unit norm in-place.

double gan_quat_sqrlen_q (Gan_Quaternion *q1)
 Macro: Return the squared length of a quaternion.

double gan_quat_sqrlen_s (Gan_Quaternion *q1)
 Macro: Return the squared length of a quaternion.

Gan_Quaterniongan_quat_add_q (Gan_Quaternion *q1, Gan_Quaternion *q2, Gan_Quaternion *q3)
 Macro: Add two quaternions.

Gan_Quaterniongan_quat_sub_q (Gan_Quaternion *q1, Gan_Quaternion *q2, Gan_Quaternion *q3)
 Macro: Subtract two quaternions.

Gan_Bool gan_rot3D_build_quaternion (Gan_Rot3D *rot, double q0, double q1, double q2, double q3)
 Fill rotation structure from quaternion.

Gan_Bool gan_rot3D_build_exponential (Gan_Rot3D *rot, double rx, double ry, double rz)
 Fill rotation structure from exponential rotation parameters.

Gan_Bool gan_rot3D_build_angle_axis (Gan_Rot3D *rot, double angle, double ax, double ay, double az)
 Fill rotation structure from angle/axis rotation parameters.

Gan_Bool gan_rot3D_build_matrix (Gan_Rot3D *rot, double Rxx, double Rxy, double Rxz, double Ryx, double Ryy, double Ryz, double Rzx, double Rzy, double Rzz)
 Fill rotation structure from matrix rotation parameters.

Gan_Bool gan_rot3D_ident_q (Gan_Rot3D *rot, Gan_Rot3D_Type type)
 Set null rotation with given type.

Gan_Rot3D gan_rot3D_ident_s (Gan_Rot3D_Type type)
 Return null rotation with given type.

Gan_Bool gan_rot3D_apply_v3_q (Gan_Rot3D *rot, Gan_Vector3 *X, Gan_Vector3 *X_new)
 Apply a rotation to a 3D point.

Gan_Vector3 gan_rot3D_apply_v3_s (Gan_Rot3D *rot, Gan_Vector3 *X)
 Return the rotation of a 3D point.

Gan_Bool gan_rot3D_mult_q (Gan_Rot3D *rot1, Gan_Rot3D *rot2, Gan_Rot3D *rot3)
 Combine two rotations into a third.

Gan_Rot3D gan_rot3D_mult_s (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Combine two rotations and return a third.

Gan_Bool gan_rot3D_multI_q (Gan_Rot3D *rot1, Gan_Rot3D *rot2, Gan_Rot3D *rot3)
 Combine two rotations into a third.

Gan_Rot3D gan_rot3D_multI_s (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Combine two rotations and return a third.

Gan_Bool gan_rot3D_scale_q (Gan_Rot3D *rot_s, double scale, Gan_Rot3D *rot_d)
 Scale rotation parameters.

Gan_Rot3D gan_rot3D_scale_s (Gan_Rot3D *rot_s, double scale)
 Multiply rotation parameters by scalar.

Gan_Bool gan_rot3D_divide_q (Gan_Rot3D *rot_s, double scale, Gan_Rot3D *rot_d)
 Divide rotation parameters by scalar.

Gan_Rot3D gan_rot3D_divide_s (Gan_Rot3D *rot_s, double scale)
 Divide rotation parameters by scalar.

Gan_Bool gan_rot3D_add_q (Gan_Rot3D *rot1, Gan_Rot3D *rot2, Gan_Rot3D *rot3)
 Add two sets of rotation parameters together.

Gan_Rot3D gan_rot3D_add_s (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Add two sets of rotation parameters together.

Gan_Bool gan_rot3D_sub_q (Gan_Rot3D *rot1, Gan_Rot3D *rot2, Gan_Rot3D *rot3)
 Subtract two sets of rotation parameters from each other.

Gan_Rot3D gan_rot3D_sub_s (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Subtract two sets of rotation parameters from each other.

Gan_Bool gan_rot3D_convert_q (Gan_Rot3D *rot_s, Gan_Rot3D_Type type, Gan_Rot3D *rot_d)
 Convert rotation from one type to another.

Gan_Rot3D gan_rot3D_convert_s (Gan_Rot3D *rot_s, Gan_Rot3D_Type type)
 Return conversion of rotation from one type to another.

Gan_Bool gan_rot3D_from_quaternion_q (Gan_Rot3D *rot, Gan_Quaternion *q, Gan_Rot3D_Type type)
 Convert rotation from quaternion to another type.

Gan_Bool gan_rot3D_from_exponential_q (Gan_Rot3D *rot, Gan_Vector3 *r, Gan_Rot3D_Type type)
 Convert rotation from exponential to another type.

Gan_Rot3D gan_rot3D_from_quaternion_s (Gan_Quaternion *q, Gan_Rot3D_Type type)
 Return conversion of rotation from quaternion to another type.

Gan_Rot3D gan_rot3D_from_exponential_s (Gan_Vector3 *r, Gan_Rot3D_Type type)
 Return conversion of rotation from exponential to another type.

Gan_Bool gan_rot3D_from_angle_axis_q (Gan_Rot3D *rot, double angle, Gan_Vector3 *axis, Gan_Rot3D_Type type)
 Convert rotation from angle/axis to another type.

Gan_Rot3D gan_rot3D_from_angle_axis_s (double angle, Gan_Vector3 *axis, Gan_Rot3D_Type type)
 Return conversion of rotation from angle/axis to another type.

Gan_Bool gan_rot3D_from_matrix_q (Gan_Rot3D *rot, Gan_Matrix33 *R, Gan_Rot3D_Type type)
 Convert rotation from matrix to another type.

Gan_Rot3D gan_rot3D_from_matrix_s (Gan_Matrix33 *R, Gan_Rot3D_Type type)
 Return conversion of rotation from matrix to another type.

Gan_Bool gan_rot3D_matrix_adjust (Gan_Matrix33 *R)
 Adjust rotation matrix to be orthogonal using SVD.

Gan_Bool gan_rot3D_scale_i (Gan_Rot3D *rot, double s)
 Macro: Scale rotation parameters in-place.

Gan_Bool gan_rot3D_divide_i (Gan_Rot3D *rot, double s)
 Macro: Divide rotation parameters by a scalar in-place.

Gan_Bool gan_rot3D_increment (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Macro: Add two sets of rotation parameters.

Gan_Bool gan_rot3D_add_i2 (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Macro: Add two sets of rotation parameters.

Gan_Bool gan_rot3D_decrement (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Macro: Subtract two sets of rotation parameters.

Gan_Bool gan_rot3D_sub_i2 (Gan_Rot3D *rot1, Gan_Rot3D *rot2)
 Macro: Subtract two sets of rotation parameters.


Detailed Description

Module: Handling 3D rotations

Part of: Gandalf Library

Revision: Last edited: Author:

Copyright: (c) 2000 Imagineer Software Limited


Function Documentation

Gan_Quaternion gan_quat_divide_s Gan_Quaternion   q,
double    s
 

Divide quaternion by scalar.

void gan_quat_fill_q Gan_Quaternion   q,
double    q0,
double    q1,
double    q2,
double    q3
 

Fill quaternion with values.

Parameters:
q Pointer to quaternion to fill
q0 First element of q, representing the rotation angle
q1 Second element of q, representing the rotation axis x-coordinate
q2 Second element of q, representing the rotation axis y-coordinate
q3 Second element of q, representing the rotation axis z-coordinate
Fills a structure containing a quaternion with its four elements.

Returns:
no value.
See also:
gan_quat_fill_s()

Gan_Quaternion gan_quat_fill_s double    q0,
double    q1,
double    q2,
double    q3
 

Fill quaternion with values.

Parameters:
q0 First element of q, representing the rotation angle
q1 Second element of q, representing the rotation axis x-coordinate
q2 Second element of q, representing the rotation axis y-coordinate
q3 Second element of q, representing the rotation axis z-coordinate
Fills a structure containing a quaternion with its four elements.

Returns:
a filled quaternion structure.
See also:
gan_quat_fill_q()

Gan_Quaternion gan_quat_scale_s Gan_Quaternion   q,
double    s
 

Multiply all the elements of a quaternion by a scalar value.

Parameters:
q Pointer to quaternion to rescale
s Scalar value by which to multiply quaternion
Multiplies all the elements of a quaternion by the same scalar value.

Returns:
a quaternion structure containing the new elements.
See also:
gan_quat_divide_s()

Gan_Quaternion gan_quat_unit_s Gan_Quaternion   q
 

Scale quaternion to unit length.

Gan_Bool gan_rot3D_add_q Gan_Rot3D   rot1,
Gan_Rot3D   rot2,
Gan_Rot3D   rot3
 

Add two sets of rotation parameters together.

Gan_Rot3D gan_rot3D_add_s Gan_Rot3D   rot1,
Gan_Rot3D   rot2
 

Add two sets of rotation parameters together.

Gan_Bool gan_rot3D_apply_v3_q Gan_Rot3D   rot,
Gan_Vector3   X,
Gan_Vector3   X_new
 

Apply a rotation to a 3D point.

Rotation definition is .

Gan_Vector3 gan_rot3D_apply_v3_s Gan_Rot3D   rot,
Gan_Vector3   X
 

Return the rotation of a 3D point.

Returns .

Gan_Bool gan_rot3D_build_angle_axis Gan_Rot3D   rot,
double    angle,
double    ax,
double    ay,
double    az
 

Fill rotation structure from angle/axis rotation parameters.

Gan_Bool gan_rot3D_build_exponential Gan_Rot3D   rot,
double    rx,
double    ry,
double    rz
 

Fill rotation structure from exponential rotation parameters.

Gan_Bool gan_rot3D_build_matrix Gan_Rot3D   rot,
double    Rxx,
double    Rxy,
double    Rxz,
double    Ryx,
double    Ryy,
double    Ryz,
double    Rzx,
double    Rzy,
double    Rzz
 

Fill rotation structure from matrix rotation parameters.

Gan_Bool gan_rot3D_build_quaternion Gan_Rot3D   rot,
double    q0,
double    q1,
double    q2,
double    q3
 

Fill rotation structure from quaternion.

Gan_Bool gan_rot3D_convert_q Gan_Rot3D   rot_s,
Gan_Rot3D_Type    type,
Gan_Rot3D   rot_d
 

Convert rotation from one type to another.

Gan_Rot3D gan_rot3D_convert_s Gan_Rot3D   rot_s,
Gan_Rot3D_Type    type
 

Return conversion of rotation from one type to another.

Gan_Bool gan_rot3D_divide_q Gan_Rot3D   rot_s,
double    scale,
Gan_Rot3D   rot_d
 

Divide rotation parameters by scalar.

Gan_Rot3D gan_rot3D_divide_s Gan_Rot3D   rot_s,
double    scale
 

Divide rotation parameters by scalar.

Gan_Bool gan_rot3D_from_angle_axis_q Gan_Rot3D   rot,
double    angle,
Gan_Vector3   axis,
Gan_Rot3D_Type    type
 

Convert rotation from angle/axis to another type.

Gan_Rot3D gan_rot3D_from_angle_axis_s double    angle,
Gan_Vector3   axis,
Gan_Rot3D_Type    type
 

Return conversion of rotation from angle/axis to another type.

Gan_Bool gan_rot3D_from_exponential_q Gan_Rot3D   rot,
Gan_Vector3   r,
Gan_Rot3D_Type    type
 

Convert rotation from exponential to another type.

Gan_Rot3D gan_rot3D_from_exponential_s Gan_Vector3   r,
Gan_Rot3D_Type    type
 

Return conversion of rotation from exponential to another type.

Gan_Bool gan_rot3D_from_matrix_q Gan_Rot3D   rot,
Gan_Matrix33   R,
Gan_Rot3D_Type    type
 

Convert rotation from matrix to another type.

Gan_Rot3D gan_rot3D_from_matrix_s Gan_Matrix33   R,
Gan_Rot3D_Type    type
 

Return conversion of rotation from matrix to another type.

Gan_Bool gan_rot3D_from_quaternion_q Gan_Rot3D   rot,
Gan_Quaternion   q,
Gan_Rot3D_Type    type
 

Convert rotation from quaternion to another type.

Gan_Rot3D gan_rot3D_from_quaternion_s Gan_Quaternion   q,
Gan_Rot3D_Type    type
 

Return conversion of rotation from quaternion to another type.

Gan_Bool gan_rot3D_ident_q Gan_Rot3D   rot,
Gan_Rot3D_Type    type
 

Set null rotation with given type.

Gan_Rot3D gan_rot3D_ident_s Gan_Rot3D_Type    type
 

Return null rotation with given type.

Gan_Bool gan_rot3D_matrix_adjust Gan_Matrix33   R
 

Adjust rotation matrix to be orthogonal using SVD.

Gan_Bool gan_rot3D_mult_q Gan_Rot3D   rot1,
Gan_Rot3D   rot2,
Gan_Rot3D   rot3
 

Combine two rotations into a third.

For matrices .

Gan_Rot3D gan_rot3D_mult_s Gan_Rot3D   rot1,
Gan_Rot3D   rot2
 

Combine two rotations and return a third.

For matrices return .

Gan_Bool gan_rot3D_multI_q Gan_Rot3D   rot1,
Gan_Rot3D   rot2,
Gan_Rot3D   rot3
 

Combine two rotations into a third.

For matrices .

Gan_Rot3D gan_rot3D_multI_s Gan_Rot3D   rot1,
Gan_Rot3D   rot2
 

Combine two rotations and return a third.

For matrices returns .

Gan_Bool gan_rot3D_scale_q Gan_Rot3D   rot_s,
double    scale,
Gan_Rot3D   rot_d
 

Scale rotation parameters.

Gan_Rot3D gan_rot3D_scale_s Gan_Rot3D   rot_s,
double    scale
 

Multiply rotation parameters by scalar.

Gan_Bool gan_rot3D_sub_q Gan_Rot3D   rot1,
Gan_Rot3D   rot2,
Gan_Rot3D   rot3
 

Subtract two sets of rotation parameters from each other.

Gan_Rot3D gan_rot3D_sub_s Gan_Rot3D   rot1,
Gan_Rot3D   rot2
 

Subtract two sets of rotation parameters from each other.


Generated on Mon Oct 13 16:14:46 2003 by doxygen1.3-rc1