#include <gvector.h>
Inheritance diagram for GVectors::GVector:

Public Member Functions | |
| GVector () | |
| Constructor. | |
| GVector (double x, double y, double z) | |
| Constructor. | |
| virtual | ~GVector () |
| Destructor. | |
| GVector (const GVector &v) | |
| Copy constructor. | |
| void | setZ (double z) |
| Set the value of the z component. | |
| void | Z (double z) |
| Set the value of the z component. | |
| void | set (double x, double y, double z) |
| Set all components. | |
| double | getZ () const |
| Get the value of the z component. | |
| double | Z () const |
| Get the value of the z component. | |
| void | get (double &x, double &y, double &z) const |
| Get all components. | |
| bool | iszero () const |
| Indicates whether or not the vector is a zero vector. | |
| double | abs () const |
| The absolute value of the vector (norm). | |
| const GVector | cross (const GVector &v) const |
| Cross product of two vectors. | |
| const double | angle (const GVector &v, Angle_Type at) const |
| Angle between two vectors. | |
| const GVector | connecting (const GVector &v) const |
| Vector connecting two vectors. | |
| const GVector | middle (const GVector &v) const |
| The middle of two vectors. | |
| void | invert () |
| Invert the vector. | |
| virtual void | print () const |
| Print the vector to stdout. | |
| const GVector & | operator= (const GVector &v) |
| Assignment operator. | |
| GVector | operator+ (const GVector &v) const |
| Add two vectors. | |
| GVector | operator- (const GVector &v) const |
| Subtract two vectors. | |
| double | operator * (const GVector &v) const |
| Multiply two vectors (scalar product; dot operator). | |
| GVector | operator * (const double &d) const |
| Multiply by a scalar value. | |
| GVector | operator/ (const double &d) const |
| Divide by a scalar value. | |
| const GVector & | operator+= (const GVector &v) |
| Assignment addition. | |
| const GVector & | operator-= (const GVector &v) |
| Assignment subtraction. | |
| const GVector & | operator *= (double d) |
| Assignment multiplication by a scalar value. | |
Protected Attributes | |
| double | z_ord |
| The z component representing the third dimension. | |
| GVector::GVector | ( | ) |
Initializes all components to zero.
| GVector::GVector | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) |
Initializes all components with the given values.
| x | Value of the x component. | |
| y | Value of the y component. | |
| z | Value of the z component. |
| GVector::~GVector | ( | ) | [virtual] |
Does nothing. Just for completeness.
| GVector::GVector | ( | const GVector & | v | ) |
| void GVector::setZ | ( | double | z | ) |
Sets the z component to the given value.
| z | New value of the z component. |
| void GVector::Z | ( | double | z | ) |
Sets the z component to the given value.
| z | New value of the z component. |
| void GVector::set | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) |
Sets all component to the given values.
| x | New value of the x component. | |
| y | New value of the y component. | |
| z | New value of the z component. |
| double GVector::getZ | ( | ) | const |
Returns the value of the z component.
| double GVector::Z | ( | ) | const |
Returns the value of the z component.
| void GVector::get | ( | double & | x, | |
| double & | y, | |||
| double & | z | |||
| ) | const |
Retrieves all values of the components.
| x | Reference to the variable taking the x component. | |
| y | Reference to the variable taking the y component. | |
| z | Reference to the variable taking the z component. |
| bool GVector::iszero | ( | ) | const |
Indicates whether or not the vector is a zero vector, thus all components are equal zero.
| true | The vector is a zero vector. | |
| false | The vector is not a zero vector. |
| double GVector::abs | ( | ) | const |
Calculates the absolute value (norm) of the vector.
|v| = sqrt(x^2+y^2+z^2)
| const double GVector::angle | ( | const GVector & | v, | |
| Angle_Type | at | |||
| ) | const |
Calculates the angle between two vectors.
| v | A const reference to a GVector. | |
| at | The unit of the angle to be returned. See Angle_Type. |
| void GVector::invert | ( | ) |
Inverts the vector by multiplying it by -1 ('minus one').
| void GVector::print | ( | ) | const [virtual] |
Prints the vector to stdout using the format [x,y,z].
Assigns one vector to another.
| v | A const reference to the GVector to be assigned. |
Reimplemented in GVectors::VisualVector.
Adds two vectors.
| v | A const reference to the addend. |
Subtracts two vectors.
| v | A const reference to the subtrahend. |
| double GVector::operator * | ( | const GVector & | v | ) | const |
Calculates the scalar product of two vectors.
s = x1 * x2 + y1 * y2 + z1 * z2
| v | A const reference to a GVector. |
| GVector GVector::operator * | ( | const double & | d | ) | const |
Multiplies a vector by a scalar value.
| d | A double representing the scalar value. |
| GVector GVector::operator/ | ( | const double & | d | ) | const |
Divides a vector by a scalar value.
| d | A double representing the scalar value. |
Shorthand operator for addition and assignment.
| v | A const reference to the addend GVector. |
Shorthand operator for subtraction and assignment.
| v | A const reference to the subtrahend GVector. |
| const GVector & GVector::operator *= | ( | double | d | ) |
Shorthand operator for multiplication by a scalar value and assignment.
| d | A double representing the scalar value. |
double GVectors::GVector::z_ord [protected] |
The z component representing the third dimension.
1.4.7