#include <position.hxx>
Public Member Functions | |
| double & | coordinate (int i) |
| Extracts the ith component value. | |
| double | coordinate (int i) const |
| Returns the ith component value. | |
| void | debug (FILE *fp=debug_file_ptr) const |
| Writes information about the position to the debug file or the specified file. | |
| void | debug_str (char *strP) const |
| Concatenates the information about the position to the passed string. | |
| SPAposition const & | operator*= (SPAtransf const &t) |
| Transforms a position. | |
| SPAposition const & | operator*= (SPAmatrix const &m) |
| Transforms a vector by an affine transformation matrix. | |
| SPAposition const & | operator+= (SPAvector const &v) |
| Translates a position by a vector. | |
| SPAposition const & | operator-= (SPAvector const &v) |
| Translates a position by a vector. | |
| void | set_coordinate (int i, double new_c) |
| Sets the ith component value. | |
| void | set_x (double new_x) |
| Sets the x-coordinate value. | |
| void | set_y (double new_y) |
| Sets the y-coordinate value. | |
| void | set_z (double new_z) |
| Sets the z-coordinate value. | |
| SPAposition (SPAposition const &p) | |
| C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument. | |
| SPAposition (double p[3]) | |
| C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments. | |
| SPAposition (double xi, double yi, double zi) | |
| C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments. | |
| SPAposition () | |
| C++ allocation constructor requests memory for this object but does not populate it. | |
| double & | x () |
| Extracts the x-coordinate value. | |
| double | x () const |
| Returns the x-coordinate value. | |
| double & | y () |
| Extracts the y-coordinate value. | |
| double | y () const |
| Returns the y-coordinate value. | |
| double & | z () |
| Extracts the z-coordinate value. | |
| double | z () const |
| Returns the z-coordinate value. | |
Friends | |
| SPAposition | interpolate (double param, SPAposition const &p1, SPAposition const &p2) |
| Interpolates between two positions. | |
| double | operator% (SPAunit_vector const &uv, SPAposition const &p) |
| Returns the dot-product of a unit vector and a position. | |
| double | operator% (SPAposition const &p, SPAunit_vector const &uv) |
| Returns the dot-product of a position and a unit vector. | |
| double | operator% (SPAvector const &v, SPAposition const &p) |
| Returns the scalar product of vector with a position. | |
| double | operator% (SPAposition const &p, SPAvector const &v) |
| Returns the scalar product of a position with a vector. | |
| SPAposition | operator* (SPAposition const &p, SPAtransf const *t) |
| Transforms a position. | |
| SPAposition | operator* (SPAposition const &p, SPAtransf const &t) |
| Transforms a position. | |
| SPAposition | operator* (SPAposition const &p, SPAmatrix const &m) |
| Transforms a position. | |
| SPAposition | operator* (SPAmatrix const &m, SPAposition const &p) |
| Transforms a position. | |
| SPAposition | operator* (SPAunit_vector const &uv, SPAposition const &p) |
| Returns the cross product of a unit vector with a position. | |
| SPAposition | operator* (SPAposition const &p, SPAunit_vector const &uv) |
| Returns the cross product of a position with a unit vector. | |
| SPAposition | operator* (SPAposition const &p, double d) |
| Multiplies a position by a double. | |
| SPAposition | operator+ (SPAvector const &v, SPAposition const &p) |
| Translates a position by a vector. | |
| SPAposition | operator+ (SPAposition const &p, SPAvector const &v) |
| Translates a position by a vector. | |
| SPAposition | operator- (SPAposition const &p, SPAvector const &v) |
| Translates a position by a vector. | |
| SPAvector | operator- (SPAposition const &p1, SPAposition const &p2) |
| Returns the displacement (a vector) as the difference of two positions. | |
| logical | same_point (SPAposition const &p1, SPAposition const &p2, const double res) |
Returns TRUE if the two positions are the same (i.e., they lie within the specified resolution or SPAresabs); otherwise returns FALSE. | |
Role: This class represents position vectors (points) in 3D Cartesian space that are subject to certain vector and transformation operations. This class is distinct from the SPAvector class, which is a displacement and is origin independent.
| SPAposition::SPAposition | ( | ) | [inline] |
C++ allocation constructor requests memory for this object but does not populate it.
| SPAposition::SPAposition | ( | double | xi, | |
| double | yi, | |||
| double | zi | |||
| ) | [inline] |
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.
Role: Creates a SPAposition using the x, y, z coordinates.
| xi | x-coordinate value. | |
| yi | y-coordinate value. | |
| zi | z-coordinate value. |
| SPAposition::SPAposition | ( | double | p[3] | ) | [inline] |
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.
Role: Creates a SPAposition using the specified array of three doubles, specifying the x, y, z coordinates.
| p | array of 3 doubles. |
| SPAposition::SPAposition | ( | SPAposition const & | p | ) | [inline] |
C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument.
| p | given position. |
| double& SPAposition::coordinate | ( | int | i | ) | [inline] |
Extracts the ith component value.
The x coordinate has an index value of 0, the y coordinate has an index value of 1, and the z coordinate has an index value of 2.
| i | ith component. |
| double SPAposition::coordinate | ( | int | i | ) | const [inline] |
Returns the ith component value.
The x coordinate has an index value of 0, the y coordinate has an index value of 1, and the z coordinate has an index value of 2.
| i | ith component. |
| void SPAposition::debug | ( | FILE * | fp = debug_file_ptr |
) | const |
Writes information about the position to the debug file or the specified file.
| fp | output file. |
| void SPAposition::debug_str | ( | char * | strP | ) | const |
Concatenates the information about the position to the passed string.
| strP | given string. |
| SPAposition const& SPAposition::operator*= | ( | SPAtransf const & | t | ) |
Transforms a position.
| t | transformation. |
| SPAposition const& SPAposition::operator*= | ( | SPAmatrix const & | m | ) |
Transforms a vector by an affine transformation matrix.
| m | affine transformation matrix. |
| SPAposition const& SPAposition::operator+= | ( | SPAvector const & | v | ) |
Translates a position by a vector.
| v | vector. |
| SPAposition const& SPAposition::operator-= | ( | SPAvector const & | v | ) |
Translates a position by a vector.
| v | vector. |
| void SPAposition::set_coordinate | ( | int | i, | |
| double | new_c | |||
| ) | [inline] |
Sets the ith component value.
The x coordinate has an index value of 0, the y coordinate has an index value of 1, and the z coordinate has an index value of 2.
| i | ith component. | |
| new_c | new coordinate value. |
| void SPAposition::set_x | ( | double | new_x | ) | [inline] |
Sets the x-coordinate value.
| new_x | new x-coordinate value. |
| void SPAposition::set_y | ( | double | new_y | ) | [inline] |
Sets the y-coordinate value.
| new_y | new y-coordinate value. |
| void SPAposition::set_z | ( | double | new_z | ) | [inline] |
Sets the z-coordinate value.
| new_z | new z-coordinate value. |
| double& SPAposition::x | ( | ) | [inline] |
Extracts the x-coordinate value.
| double SPAposition::x | ( | ) | const [inline] |
Returns the x-coordinate value.
| double& SPAposition::y | ( | ) | [inline] |
Extracts the y-coordinate value.
| double SPAposition::y | ( | ) | const [inline] |
Returns the y-coordinate value.
| double& SPAposition::z | ( | ) | [inline] |
Extracts the z-coordinate value.
| double SPAposition::z | ( | ) | const [inline] |
Returns the z-coordinate value.
| SPAposition interpolate | ( | double | param, | |
| SPAposition const & | p1, | |||
| SPAposition const & | p2 | |||
| ) | [friend] |
Interpolates between two positions.
Role: The parameter gives the portion of the segment between the first position and the second position. This function returns:
((1 - parameter)*p1 + (parameter*p2))
for the given parameter and two positions. If the parameter is less than 0 or greater than 1, the function extrapolates.
Effect: Read-only
| param | parameter for interpolation. | |
| p1 | first position (p1). | |
| p2 | second position (p2). |
| double operator% | ( | SPAunit_vector const & | uv, | |
| SPAposition const & | p | |||
| ) | [friend] |
Returns the dot-product of a unit vector and a position.
| uv | unit vector. | |
| p | position. |
| double operator% | ( | SPAposition const & | p, | |
| SPAunit_vector const & | uv | |||
| ) | [friend] |
Returns the dot-product of a position and a unit vector.
| p | position. | |
| uv | unit vector. |
| double operator% | ( | SPAvector const & | v, | |
| SPAposition const & | p | |||
| ) | [friend] |
Returns the scalar product of vector with a position.
| v | vector. | |
| p | position. |
| double operator% | ( | SPAposition const & | p, | |
| SPAvector const & | v | |||
| ) | [friend] |
Returns the scalar product of a position with a vector.
| p | position. | |
| v | vector. |
| SPAposition operator* | ( | SPAposition const & | p, | |
| SPAtransf const * | t | |||
| ) | [friend] |
Transforms a position.
| p | position. | |
| t | transformation. |
| SPAposition operator* | ( | SPAposition const & | p, | |
| SPAtransf const & | t | |||
| ) | [friend] |
Transforms a position.
| p | position. | |
| t | transformation. |
| SPAposition operator* | ( | SPAposition const & | p, | |
| SPAmatrix const & | m | |||
| ) | [friend] |
Transforms a position.
| p | position. | |
| m | affine transformation matrix. |
| SPAposition operator* | ( | SPAmatrix const & | m, | |
| SPAposition const & | p | |||
| ) | [friend] |
Transforms a position.
| m | affine transformation matrix. | |
| p | position. |
| SPAposition operator* | ( | SPAunit_vector const & | uv, | |
| SPAposition const & | p | |||
| ) | [friend] |
Returns the cross product of a unit vector with a position.
| uv | unit vector. | |
| p | position. |
| SPAposition operator* | ( | SPAposition const & | p, | |
| SPAunit_vector const & | uv | |||
| ) | [friend] |
Returns the cross product of a position with a unit vector.
| p | position. | |
| uv | unit vector. |
| SPAposition operator* | ( | SPAposition const & | p, | |
| double | d | |||
| ) | [friend] |
Multiplies a position by a double.
| p | position. | |
| d | double. |
| SPAposition operator+ | ( | SPAvector const & | v, | |
| SPAposition const & | p | |||
| ) | [friend] |
Translates a position by a vector.
| v | vector. | |
| p | position. |
| SPAposition operator+ | ( | SPAposition const & | p, | |
| SPAvector const & | v | |||
| ) | [friend] |
Translates a position by a vector.
| p | position. | |
| v | vector. |
| SPAposition operator- | ( | SPAposition const & | p, | |
| SPAvector const & | v | |||
| ) | [friend] |
Translates a position by a vector.
| p | position. | |
| v | vector. |
| SPAvector operator- | ( | SPAposition const & | p1, | |
| SPAposition const & | p2 | |||
| ) | [friend] |
Returns the displacement (a vector) as the difference of two positions.
| p1 | first position. | |
| p2 | second position. |
| logical same_point | ( | SPAposition const & | p1, | |
| SPAposition const & | p2, | |||
| const double | res = SPAresabs | |||
| ) | [friend] |
Returns TRUE if the two positions are the same (i.e., they lie within the specified resolution or SPAresabs); otherwise returns FALSE.
| p1 | first position. | |
| p2 | second position. | |
| res | optional positional tolerance. |