#include <coordinates.h>
Inheritance diagram for GVectors::Coordinates:

Public Member Functions | |
| Coordinates () | |
| Constructor. | |
| Coordinates (double x, double y) | |
| Constructor. | |
| virtual | ~Coordinates () |
| Destructor. | |
| Coordinates (const Coordinates &c) | |
| Copy constructor. | |
| void | X (double x) |
| Set the x component. | |
| void | setX (double x) |
| Set the x component. | |
| void | Y (double y) |
| Set the y component. | |
| void | setY (double y) |
| Set the y component. | |
| void | set (double x, double y) |
| Set the x and y component. | |
| double | X () const |
| Get the x component. | |
| double | getX () const |
| Get the x component. | |
| double | Y () const |
| Get the y component. | |
| double | getY () const |
| Get the y component. | |
| void | get (double &x, double &y) const |
| Get the x and y component. | |
| const Coordinates & | operator= (const Coordinates &c) |
| Assignment operator. | |
| bool | operator== (const Coordinates &c) const |
| Equality operator. | |
| bool | operator!= (const Coordinates &c) const |
| Inequality operator. | |
| double | operator[] (unsigned int i) const |
| Index operator. | |
| Coordinates | operator+ (const Coordinates &c) const |
| Addition operator. | |
| Coordinates | operator- (const Coordinates &c) const |
| Subtraction operator. | |
| Coordinates | operator * (double d) const |
| Multiplication operator. | |
| double | operator * (const Coordinates &c) const |
| Dot operator. | |
| Coordinates | operator/ (double d) const |
| Division operator. | |
| const Coordinates & | operator+= (const Coordinates &c) |
| Assignment addition operator. | |
| const Coordinates & | operator-= (const Coordinates &c) |
| Assignment addition operator. | |
Protected Attributes | |
| double | x_ord |
| The x component. | |
| double | y_ord |
| The x component. | |
| Coordinates::Coordinates | ( | ) |
Initializes the x and y component to zero.
| Coordinates::Coordinates | ( | double | x, | |
| double | y | |||
| ) |
Initializes the x and y component to the given values.
| x | The value of the x component. | |
| y | The value of the y component. |
| Coordinates::~Coordinates | ( | ) | [virtual] |
Does nothing. Just for completeness.
| Coordinates::Coordinates | ( | const Coordinates & | c | ) |
| void Coordinates::X | ( | double | x | ) |
Sets the x component to the given value.
| x | The new value of the x component. |
| void Coordinates::setX | ( | double | x | ) |
Sets the x component to the given value.
| x | The new value of the x component. |
| void Coordinates::Y | ( | double | y | ) |
Sets the y component to the given value.
| y | The new value of the y component. |
| void Coordinates::setY | ( | double | y | ) |
Sets the y component to the given value.
| y | The new value of the y component. |
| void Coordinates::set | ( | double | x, | |
| double | y | |||
| ) |
Sets the x and y component to the given values.
| x | The new value of the x component. | |
| y | The new value of the y component. |
| double Coordinates::X | ( | ) | const |
Gets the value of the x component.
| double Coordinates::getX | ( | ) | const |
Gets the value of the x component.
| double Coordinates::Y | ( | ) | const |
Gets the value of the y component.
| double Coordinates::getY | ( | ) | const |
Gets the value of the y component.
| void Coordinates::get | ( | double & | x, | |
| double & | y | |||
| ) | const |
Gets the value of the x and y component.
| x | A reference to a double which will receive the value of the x component. | |
| y | A reference to a double which will receive the value of the y component. |
| const Coordinates & Coordinates::operator= | ( | const Coordinates & | c | ) |
Assigns one Coordinates to another.
| c | A const reference to the Coordinates to be assigned to this. |
| bool Coordinates::operator== | ( | const Coordinates & | c | ) | const |
Compares two Coordinates classes for equality.
| c | A reference to a Coordinates class to be compared to this. |
| true | Both classes have identical x and y components. | |
| false | The classes differ in either the x or y components or in both components. |
| bool Coordinates::operator!= | ( | const Coordinates & | c | ) | const |
Compares two classes for inequality.
| c | A reference to a Coordinates class to be compared to this. |
| true | The classes differ in either the x or y components or in both components. | |
| false | Both classes have identical x and y components. |
| double Coordinates::operator[] | ( | unsigned int | i | ) | const |
Index operator.
| i | The index to retrieve. Pass 0 ('zero') for the x component or 1 ('one') for the y component. |
| std::out_of_range | if i not in {0,1}. |
| Coordinates Coordinates::operator+ | ( | const Coordinates & | c | ) | const |
Adds another Coordinates class component wise to this and returns the sum.
| c | A const reference to the Coordinates class to be added to this. |
| Coordinates Coordinates::operator- | ( | const Coordinates & | c | ) | const |
Subtracts another Coordinates class component wise from this and returns the sum.
| c | A const reference to the Coordinates class to be subtracted from this. |
| Coordinates Coordinates::operator * | ( | double | d | ) | const |
Multiplies the scalar value d with both components.
| d | A double value representing the factor. |
| double Coordinates::operator * | ( | const Coordinates & | c | ) | const |
Multiplies two Coordinates classes (dot operator).
| c | A const reference to the Coordinates class representing the factor. |
| Coordinates Coordinates::operator/ | ( | double | d | ) | const |
Divides this Coordinates by the value of d.
| d | A double representing the divisor. |
| const Coordinates & Coordinates::operator+= | ( | const Coordinates & | c | ) |
Adds and assigns a Coordinates class to this.
| c | A const reference to the addend. |
| const Coordinates & Coordinates::operator-= | ( | const Coordinates & | c | ) |
Subtracts and assigns a Coordinates class from this.
| c | A const reference to the subtrahend. |
double GVectors::Coordinates::x_ord [protected] |
Holds the x component.
double GVectors::Coordinates::y_ord [protected] |
Holds the x component.
1.4.7