Simbody
3.6

A CoordinateDirection is a CoordinateAxis plus a direction indicating the positive or negative direction along that axis. More...
Classes  
class  Negative 
Use for compiletime construction of a negative CoordinateDirection along one of the coordinate axes. More...  
class  NegXDirection 
class  NegYDirection 
class  NegZDirection 
Public Member Functions  
CoordinateDirection (const CoordinateAxis &axis)  
Implicit conversion of a CoordinateAxis to a positive CoordinateDirection along that axis. More...  
CoordinateDirection (const CoordinateAxis &axis, Negative)  
Explicit creation of a negative CoordinateDirection from a CoordinateAxis. More...  
CoordinateDirection (const CoordinateAxis &axis, int direction)  
Explicit creation of a CoordinateDirection from a CoordinateAxis and a direction calculated at run time. More...  
CoordinateAxis  getAxis () const 
This is the coordinate axis XAxis, YAxis, or ZAxis contained in this CoordinateDirection. Use getDirection() to determine whether this is the positive or negative direction. More...  
int  getDirection () const 
Returns 1 or 1 to indicate the direction along the coordinate axis returned by getAxis(). More...  
bool  hasSameAxis (const CoordinateDirection &dir2) const 
Return true if this direction and dir2 are along the same axis, even if the direction along that axis is not the same. More...  
bool  isSameAxisAndDirection (const CoordinateDirection &dir2) const 
Return true if this direction and dir2 are along the same axis, and in the same direction along that axis. You can also use operator==() for this comparison. More...  
int  dotProduct (const CoordinateDirection &dir2) const 
Perform a specialized dot product between this coordinate direction and dir2; returning 1 or 1 if they contain the same axis and 0 otherwise, without performing any floating point operations. More...  
int  crossProductSign (const CoordinateDirection &dir2) const 
Return the sign that would result from a cross product between this coordinate direction and dir2: 0 if they are along the same axis; 1 if the result would be in the positive direction along the third axis; 1 if it would be in the negative direction. More...  
CoordinateAxis  crossProductAxis (const CoordinateDirection &dir2) const 
Return the coordinate axis along which the cross product of this coordinate direction and dir2 would lie: same as this if both contain the same axis (doesn't matter because the sign would be zero); otherwise, the third axis that neither this one nor dir2 contains. More...  
CoordinateAxis  crossProduct (const CoordinateDirection &dir2, int &sign) const 
Return the axis and sign along that axis that would result from a cross product between this coordinate direction and dir2; this combines the functions of both crossProductAxis() and crossProductSign(). More...  
Related Functions  
(Note that these are not member functions.)  
bool  operator== (const CoordinateDirection &d1, const CoordinateDirection &d2) 
Compare two CoordinateDirection objects. More...  
bool  operator!= (const CoordinateDirection &d1, const CoordinateDirection &d2) 
Compare two CoordinateDirection objects. More...  
const CoordinateAxis::XCoordinateAxis &  operator (const CoordinateDirection::NegXDirection &) 
Create the XAxis direction by negating NegXAxis. More...  
const CoordinateAxis::YCoordinateAxis &  operator (const CoordinateDirection::NegYDirection &) 
Create the YAxis direction by negating NegYAxis. More...  
const CoordinateAxis::ZCoordinateAxis &  operator (const CoordinateDirection::NegZDirection &) 
Create the ZAxis direction by negating NegZAxis. More...  
CoordinateDirection  operator (const CoordinateDirection &dir) 
Create the opposite direction from the given direction. More...  
A CoordinateDirection is a CoordinateAxis plus a direction indicating the positive or negative direction along that axis.
There are only six possible values for a CoordinateDirection, and there are predefined constants available covering all of them:

inline 
Implicit conversion of a CoordinateAxis to a positive CoordinateDirection along that axis.

inline 
Explicit creation of a negative CoordinateDirection from a CoordinateAxis.

inline 
Explicit creation of a CoordinateDirection from a CoordinateAxis and a direction calculated at run time.
[in]  axis  XAxis, YAxis, or ZAxis 
[in]  direction  Must be 1 or 1. 

inline 
This is the coordinate axis XAxis, YAxis, or ZAxis contained in this CoordinateDirection. Use getDirection() to determine whether this is the positive or negative direction.

inline 
Returns 1 or 1 to indicate the direction along the coordinate axis returned by getAxis().

inline 
Return true if this direction and dir2 are along the same axis, even if the direction along that axis is not the same.

inline 
Return true if this direction and dir2 are along the same axis, and in the same direction along that axis. You can also use operator==() for this comparison.

inline 
Perform a specialized dot product between this coordinate direction and dir2; returning 1 or 1 if they contain the same axis and 0 otherwise, without performing any floating point operations.

inline 
Return the sign that would result from a cross product between this coordinate direction and dir2: 0 if they are along the same axis; 1 if the result would be in the positive direction along the third axis; 1 if it would be in the negative direction.
No floating point computations are performed.

inline 
Return the coordinate axis along which the cross product of this coordinate direction and dir2 would lie: same as this if both contain the same axis (doesn't matter because the sign would be zero); otherwise, the third axis that neither this one nor dir2 contains.
But note that the actual result may be along that axis or in the negative direction along that axis. No floating point computations are performed.

inline 
Return the axis and sign along that axis that would result from a cross product between this coordinate direction and dir2; this combines the functions of both crossProductAxis() and crossProductSign().
Note that if dir2 is along the same axis as this one, we'll just return this as the axis but the sign is zero since the magnitude of the result would be zero. No floating point calculations are performed.

related 
Compare two CoordinateDirection objects.

related 
Compare two CoordinateDirection objects.

related 
Create the XAxis direction by negating NegXAxis.
No computation is necessary.

related 
Create the YAxis direction by negating NegYAxis.
No computation is necessary.

related 
Create the ZAxis direction by negating NegZAxis.
No computation is necessary.

related 
Create the opposite direction from the given direction.
No computation is necessary.