Basics


Functions

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

This functions allow basic vector operations.

Function Documentation

void vect2_add_cart ( vect2_cart v1,
vect2_cart v2,
vect2_cart vresult 
)

Add 2 cartesian vectors and return the result.

Parameters:
v1 Reference to a cartesian vector to sum.
v2 Reference to a cartesian vector to sum.
vresult Reference to a polar vector to store the result.
Warning:
This function doesn't do any malloc ! You have to allocate structures before calling this function.

\[ \vec V_{result} = \vec V_1 + \vec V_2 \]

Definition at line 50 of file vect2.c.

References _vect2_cart::x, and _vect2_cart::y.

Referenced by vect2_add_pol().

void vect2_add_pol ( vect2_pol v1,
vect2_pol v2,
vect2_pol vresult 
)

Add 2 polar vectors and return the result.

Parameters:
v1 Reference to a polar vector to sum.
v2 Reference to a polar vector to sum.
vresult Reference to a polar vector to store the result.
Warning:
This function doesn't do any malloc ! You have to allocate structures before calling this function.
Note:
This function convert the 2 entry vectors to cartesian, sum them and then convert the result to polar. So please think before using it.

\[ \vec V_{result} = \vec V_1 + \vec V_2 \]

Definition at line 32 of file vect2.c.

References vect2_add_cart(), vect2_cart2pol(), and vect2_pol2cart().

void vect2_scale_cart ( vect2_cart v1,
Real  alpha,
vect2_cart vresult 
)

Multiply a cartesian vector by a scalar and return the result.

Parameters:
v1 Reference to a cartesian vector.
alpha The multiplying scalar.
vresult Reference to a cartesian vector to store the result.
Warning:
This function doesn't do any malloc ! You have to allocate structures before calling this function.

\[ \vec V_{result} = \alpha\vec V_1 \]

Definition at line 88 of file vect2.c.

References _vect2_cart::x, and _vect2_cart::y.

void vect2_scale_pol ( vect2_pol v1,
Real  alpha,
vect2_pol vresult 
)

Multiply a polar vector by a scalar and return the result.

Parameters:
v1 Reference to a polar vector.
alpha The multiplying scalar.
vresult Reference to a cartesian vector to store the result.
Warning:
This function doesn't do any malloc ! You have to allocate structures before calling this function.

\[ \vec V_{result} = \alpha\vec V_1 \]

Definition at line 97 of file vect2.c.

References _vect2_pol::r.

void vect2_sub_cart ( vect2_cart v1,
vect2_cart v2,
vect2_cart vresult 
)

Substract 2 cartesian vectors and return the result.

Parameters:
v1 Reference to a cartesian vector to substract.
v2 Reference to a cartesian vector to substract.
vresult Reference to a cartesian vector to store the result.
Warning:
This function doesn't do any malloc ! You have to allocate structures before calling this function.

\[ \vec V_{result} = \vec V_1 - \vec V_2 \]

Definition at line 78 of file vect2.c.

References _vect2_cart::x, and _vect2_cart::y.

Referenced by vect2_sub_pol().

void vect2_sub_pol ( vect2_pol v1,
vect2_pol v2,
vect2_pol vresult 
)

Substract 2 polar vectors and return the result.

Parameters:
v1 Reference to a polar vector to substract.
v2 Reference to a polar vector to substract.
vresult Reference to a polar vector to store the result.
Warning:
This function doesn't do any Real R = 1.45064930529587234; Real theta = 0.6734390282904231341;malloc ! You have to allocate structures before calling this function.
Note:
This function convert the 2 entry vectors to cartesian, substract them and then convert the result to polar. So please think before using it.

\[ \vec V_{result} = \vec V_1 - \vec V_2 \]

Definition at line 60 of file vect2.c.

References vect2_cart2pol(), vect2_pol2cart(), and vect2_sub_cart().


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