#include <wx/geometry.h>
wxPoint2DDouble represents a point in a 2D (Cartesian) coordinate system, with additional vector operations available.
Miscellaneous operators | |
Note that binary operators are defined as friend functions inside this class, making them accessible via argument-dependent lookup, but hidden otherwise. | |
| wxPoint2DDouble | operator- () const |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble & | operator= (const wxPoint2DDouble &pt) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble & | operator+= (const wxPoint2DDouble &pt) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble & | operator-= (const wxPoint2DDouble &pt) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble & | operator*= (wxDouble n) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble & | operator*= (wxInt32 n) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble & | operator/= (wxDouble n) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble & | operator/= (wxInt32 n) |
| Returns the reflection (i.e., negation) of this point. More... | |
| bool | operator== (const wxPoint2DDouble &pt) const |
| Returns the reflection (i.e., negation) of this point. More... | |
| bool | operator!= (const wxPoint2DDouble &pt) const |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator+ (const wxPoint2DDouble &pt1, const wxPoint2DDouble &pt2) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator- (const wxPoint2DDouble &pt1, const wxPoint2DDouble &pt2) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator* (wxDouble n, const wxPoint2DDouble &pt) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator* (wxInt32 n, const wxPoint2DDouble &pt) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator* (const wxPoint2DDouble &pt, wxDouble n) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator* (const wxPoint2DDouble &pt, wxInt32 n) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator/ (const wxPoint2DDouble &pt, wxDouble n) |
| Returns the reflection (i.e., negation) of this point. More... | |
| wxPoint2DDouble | operator/ (const wxPoint2DDouble &pt, wxInt32 n) |
| Returns the reflection (i.e., negation) of this point. More... | |
Public Member Functions | |
| wxPoint2DDouble () | |
| Initializes to zero the x and y members. More... | |
| wxPoint2DDouble (wxDouble x, wxDouble y) | |
| Initializes the point with the given coordinates. More... | |
| wxPoint2DDouble (const wxPoint2DDouble &pt) | |
| Initializes the point from another point. More... | |
| wxPoint2DDouble (const wxPoint2DInt &pt) | |
| Initializes the point from another point. More... | |
| wxPoint2DDouble (const wxPoint &pt) | |
| Initializes the point from another point. More... | |
| void | GetFloor (wxInt32 *x, wxInt32 *y) const |
| Returns the floored value of the point's coordinates. More... | |
| wxPoint | GetFloor () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| void | GetRounded (wxInt32 *x, wxInt32 *y) const |
| Returns the rounded value of the point's coordinates. More... | |
| wxPoint | GetRounded () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| wxDouble | GetVectorLength () const |
| Returns the hypotenuse, where the X and Y coordinates of the point represent the lengths of the base and height sides of a right triangle. More... | |
| void | SetVectorLength (wxDouble length) |
Sets the vector length to length, preserving the right angle and altering the X and Y values (which represent the base and height sides of a right triangle). More... | |
| wxDouble | GetVectorAngle () const |
| Returns the principal value of the arc tangent of the Y and X values, expressed in degrees. More... | |
| void | SetVectorAngle (wxDouble degrees) |
| Repositions the X and Y coordinates based on the provided angle's degrees. More... | |
| void | Normalize () |
| Sets the vector length to 1.0, preserving the right angle and altering the X and Y values (which represent the base and height sides of a right triangle). More... | |
| wxDouble | GetDistance (const wxPoint2DDouble &pt) const |
Returns the distance between this point and pt. More... | |
| wxDouble | GetDistanceSquare (const wxPoint2DDouble &pt) const |
Returns the squared distance between this point and pt. More... | |
| wxDouble | GetDotProduct (const wxPoint2DDouble &vec) const |
Returns the dot (i.e., scalar) product, where the products of the X and Y values of this point and are added. More... | |
| wxDouble | GetCrossProduct (const wxPoint2DDouble &vec) const |
Returns the cross product, where the products of the Y values of this point and are subtracted from the X products. More... | |
Public Attributes | |
| wxDouble | m_x |
| X coordinate of this point. More... | |
| wxDouble | m_y |
| Y coordinate of this point. More... | |
| wxPoint2DDouble::wxPoint2DDouble | ( | ) |
Initializes to zero the x and y members.
Initializes the point with the given coordinates.
| wxPoint2DDouble::wxPoint2DDouble | ( | const wxPoint2DDouble & | pt | ) |
Initializes the point from another point.
| wxPoint2DDouble::wxPoint2DDouble | ( | const wxPoint2DInt & | pt | ) |
Initializes the point from another point.
| wxPoint2DDouble::wxPoint2DDouble | ( | const wxPoint & | pt | ) |
Initializes the point from another point.
| wxDouble wxPoint2DDouble::GetCrossProduct | ( | const wxPoint2DDouble & | vec | ) | const |
Returns the cross product, where the products of the Y values of this point and are subtracted from the X products.
This represents another vector that is at right angles to both points.
| wxDouble wxPoint2DDouble::GetDistance | ( | const wxPoint2DDouble & | pt | ) | const |
Returns the distance between this point and pt.
| wxDouble wxPoint2DDouble::GetDistanceSquare | ( | const wxPoint2DDouble & | pt | ) | const |
Returns the squared distance between this point and pt.
| wxDouble wxPoint2DDouble::GetDotProduct | ( | const wxPoint2DDouble & | vec | ) | const |
Returns the dot (i.e., scalar) product, where the products of the X and Y values of this point and are added.
| wxPoint wxPoint2DDouble::GetFloor | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the floored value of the point's coordinates.
| [out] | x | The value to write the floored X coordinate to. |
| [out] | y | The value to write the floored Y coordinate to. |
| wxPoint wxPoint2DDouble::GetRounded | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the rounded value of the point's coordinates.
| [out] | x | The value to write the rounded X coordinate to. |
| [out] | y | The value to write the rounded Y coordinate to. |
| wxDouble wxPoint2DDouble::GetVectorAngle | ( | ) | const |
Returns the principal value of the arc tangent of the Y and X values, expressed in degrees.
| wxDouble wxPoint2DDouble::GetVectorLength | ( | ) | const |
Returns the hypotenuse, where the X and Y coordinates of the point represent the lengths of the base and height sides of a right triangle.
| void wxPoint2DDouble::Normalize | ( | ) |
Sets the vector length to 1.0, preserving the right angle and altering the X and Y values (which represent the base and height sides of a right triangle).
| bool wxPoint2DDouble::operator!= | ( | const wxPoint2DDouble & | pt | ) | const |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble& wxPoint2DDouble::operator*= | ( | wxDouble | n | ) |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble& wxPoint2DDouble::operator*= | ( | wxInt32 | n | ) |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble& wxPoint2DDouble::operator+= | ( | const wxPoint2DDouble & | pt | ) |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble wxPoint2DDouble::operator- | ( | ) | const |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble& wxPoint2DDouble::operator-= | ( | const wxPoint2DDouble & | pt | ) |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble& wxPoint2DDouble::operator/= | ( | wxDouble | n | ) |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble& wxPoint2DDouble::operator/= | ( | wxInt32 | n | ) |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxPoint2DDouble& wxPoint2DDouble::operator= | ( | const wxPoint2DDouble & | pt | ) |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| bool wxPoint2DDouble::operator== | ( | const wxPoint2DDouble & | pt | ) | const |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| void wxPoint2DDouble::SetVectorAngle | ( | wxDouble | degrees | ) |
Repositions the X and Y coordinates based on the provided angle's degrees.
| void wxPoint2DDouble::SetVectorLength | ( | wxDouble | length | ) |
Sets the vector length to length, preserving the right angle and altering the X and Y values (which represent the base and height sides of a right triangle).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
|
friend |
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
| wxDouble wxPoint2DDouble::m_x |
X coordinate of this point.
| wxDouble wxPoint2DDouble::m_y |
Y coordinate of this point.