wx.Point2D¶
Point2DDouble represents a point in a 2D (Cartesian) coordinate system, with additional vector operations available.
Class Hierarchy¶
Methods Summary¶
Initializes to zero the x and y members. |
|
Get() . (x,y) |
|
Returns the cross product, where the products of the Y values of this point and |
|
Returns the distance between this point and |
|
Returns the squared distance between this point and |
|
Returns the dot (i.e., scalar) product, where the products of the X and Y values of this point and |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
|
Returns an immutable representation of the |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
|
Returns the principal value of the arc tangent of the Y and X values, expressed in degrees. |
|
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. |
|
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). |
|
Repositions the X and Y coordinates based on the provided angle’s degrees. |
|
Sets the vector length to |
|
Returns the reflection (i.e., negation) of this point. |
|
Returns the reflection (i.e., negation) of this point. |
|
Returns the reflection (i.e., negation) of this point. |
|
Returns the reflection (i.e., negation) of this point. |
|
Returns the reflection (i.e., negation) of this point. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
A public C++ attribute of type Double . X coordinate of this point. |
|
A public C++ attribute of type Double . Y coordinate of this point. |
Class API¶
- class wx.Point2D(object)¶
Possible constructors:
Point2DDouble() -> None Point2DDouble(x, y) -> None Point2DDouble(pt) -> None Point2DDouble(pt) -> None
Point2DDouble represents a point in a
2D(Cartesian) coordinate system, with additional vector operations available.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Initializes to zero the x and y members.
- Return type:
None
__init__ (self, x, y)
Initializes the point with the given coordinates.
- Parameters:
x (wx.Double)
y (wx.Double)
- Return type:
None
__init__ (self, pt)
Initializes the point from another point.
- Parameters:
pt (Point2DDouble)
- Return type:
None
__init__ (self, pt)
Initializes the point from another point.
- Parameters:
pt (wx.Point)
- Return type:
None
- Get(self)¶
Get() . (x,y)
Return the x and y properties as a tuple.
- Return type:
Any
- GetCrossProduct(self, vec)¶
Returns the cross product, where the products of the Y values of this point and
aresubtracted from the X products.This represents another vector that is at right angles to both points.
- Parameters:
vec (Point2DDouble)
- Return type:
float
- GetDistance(self, pt)¶
Returns the distance between this point and
pt.- Parameters:
pt (Point2DDouble)
- Return type:
float
- GetDistanceSquare(self, pt)¶
Returns the squared distance between this point and
pt.- Parameters:
pt (Point2DDouble)
- Return type:
float
- GetDotProduct(self, vec)¶
Returns the dot (i.e., scalar) product, where the products of the X and Y values of this point and
areadded.- Parameters:
vec (Point2DDouble)
- Return type:
float
- GetFloor(self)¶
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Return type:
- GetIM(self)¶
Returns an immutable representation of the
wx.Point2Dobject, based onnamedtuple.This new object is hashable and can be used as a dictionary key, be added to sets, etc. It can be converted back into a real
wx.Point2Dwith a simple statement like this:obj = wx.Point2D(imObj).
- GetRounded(self)¶
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Return type:
- GetVectorAngle(self)¶
Returns the principal value of the arc tangent of the Y and X values, expressed in degrees.
- Return type:
float
- GetVectorLength(self)¶
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.
- Return type:
float
- Normalize(self)¶
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).
- Return type:
None
- SetVectorAngle(self, degrees)¶
Repositions the X and Y coordinates based on the provided angle’s degrees.
- Parameters:
degrees (wx.Double)
- Return type:
None
- SetVectorLength(self, 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).- Parameters:
length (wx.Double)
- Return type:
None
- __bool__(self)¶
- __getitem__(self, idx)¶
- __len__(self)¶
- __nonzero__(self)¶
- __reduce__(self)¶
- __repr__(self)¶
- __setitem__(self, idx, val)¶
- __str__(self)¶
- __ne__(self, pt)¶
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
- Parameters:
pt (Point2DDouble)
- Return type:
bool
- __iadd__(self, pt)¶
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
- Parameters:
pt (Point2DDouble)
- Return type:
Point2DDouble
- __sub__(self)¶
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
- Return type:
Point2DDouble
- __isub__(self, pt)¶
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
- Parameters:
pt (Point2DDouble)
- Return type:
Point2DDouble
- __eq__(self, pt)¶
Returns the reflection (i.e., negation) of this point.
For example, (2, 4) on a Cartesian coordinate system will become (-2, -4).
- Parameters:
pt (Point2DDouble)
- Return type:
bool
Properties¶
- Rounded¶
See
GetRounded
- VectorAngle¶
See
GetVectorAngleandSetVectorAngle
- VectorLength¶
See
GetVectorLengthandSetVectorLength
- m_x¶
A public C++ attribute of type Double . X coordinate of this point.
- m_y¶
A public C++ attribute of type Double . Y coordinate of this point.
