aversive_10-03-12/modules/base/math/vect2/vect2.h File Reference

Interface for the 2 dimensional vector module. More...

Go to the source code of this file.

Data Structures

struct  _vect2_cart
 Cartesian vector structure. More...
struct  _vect2_pol
 Polar vector structure. More...

Defines

#define TO_RAD(x)   (((double)x)*(M_PI/180.0))
#define TO_DEG(x)   (((double)x)*(180.0/M_PI))

Typedefs

typedef double Real
 Definition of reals used in vector 2d.
typedef struct _vect2_cart vect2_cart
 Cartesian vector structure.
typedef struct _vect2_pol vect2_pol
 Polar vector structure.

Functions

void vect2_pol2cart (vect2_pol *vp, vect2_cart *vc)
 Convert a polar vector to a cartesian one.
void vect2_cart2pol (vect2_cart *vc, vect2_pol *vp)
 Convert a cartesian vector to a polar one.
void vect2_add_pol (vect2_pol *v1, vect2_pol *v2, vect2_pol *vresult)
 Add 2 polar vectors and return the result.
void vect2_add_cart (vect2_cart *v1, vect2_cart *v2, vect2_cart *vresult)
 Add 2 cartesian vectors and return the result.
void vect2_sub_pol (vect2_pol *v1, vect2_pol *v2, vect2_pol *vresult)
 Substract 2 polar vectors and return the result.
void vect2_sub_cart (vect2_cart *v1, vect2_cart *v2, vect2_cart *vresult)
 Substract 2 cartesian vectors and return the result.
void vect2_scale_cart (vect2_cart *v1, Real alpha, vect2_cart *vresult)
 Multiply a cartesian vector by a scalar and return the result.
void vect2_scale_pol (vect2_pol *v1, Real alpha, vect2_pol *vresult)
 Multiply a polar vector by a scalar and return the result.


Detailed Description

Interface for the 2 dimensional vector module.

Author:
JD & Vincent
Version:
2.0
Date:
21.12.2005 @ 23:09
Todo:
Complex operations on vectors and implementation of the <french> reperes </french>
Test:
polar -> cartesian & cartesian -> polar seems to be ok.
This module provides functions to handle 2d vectors and basic geometry fucntions.

Definition in file vect2.h.


Define Documentation

#define TO_DEG (  )     (((double)x)*(180.0/M_PI))

Definition at line 42 of file vect2.h.

#define TO_RAD (  )     (((double)x)*(M_PI/180.0))

Definition at line 41 of file vect2.h.


Typedef Documentation

typedef double Real

Definition of reals used in vector 2d.

Definition at line 39 of file vect2.h.

typedef struct _vect2_cart vect2_cart

Cartesian vector structure.

typedef struct _vect2_pol vect2_pol

Polar vector structure.


Generated on Fri Mar 12 06:32:05 2010 for AVR by  doxygen 1.5.6