phoenix_title wx.Point2D

Point2DDouble represents a point in a 2D (Cartesian) coordinate system, with additional vector operations available.


class_hierarchy Class Hierarchy

Inheritance diagram for class Point2D:

method_summary Methods Summary

__init__

Initializes to zero the x and y members.

Get

Get() . (x,y)

GetCrossProduct

Returns the cross product, where the products of the Y values of this point and are subtracted from the X products.

GetDistance

Returns the distance between this point and pt .

GetDistanceSquare

Returns the squared distance between this point and pt .

GetDotProduct

Returns the dot (i.e., scalar) product, where the products of the X and Y values of this point and are added.

GetFloor

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

GetIM

Returns an immutable representation of the wx.Point2D object, based on namedtuple.

GetRounded

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

GetVectorAngle

Returns the principal value of the arc tangent of the Y and X values, expressed in degrees.

GetVectorLength

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.

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).

SetVectorAngle

Repositions the X and Y coordinates based on the provided angle’s degrees.

SetVectorLength

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).

__bool__

__getitem__

__len__

__nonzero__

__reduce__

__repr__

__setitem__

__str__

__ne__

Returns the reflection (i.e., negation) of this point.

__iadd__

Returns the reflection (i.e., negation) of this point.

__sub__

Returns the reflection (i.e., negation) of this point.

__isub__

Returns the reflection (i.e., negation) of this point.

__eq__

Returns the reflection (i.e., negation) of this point.


property_summary Properties Summary

Floor

See GetFloor

IM

See GetIM

Rounded

See GetRounded

VectorAngle

See GetVectorAngle and SetVectorAngle

VectorLength

See GetVectorLength and SetVectorLength

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.


api 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)

overload Overloaded Implementations:



__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 are subtracted 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 are added.

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:

wx.Point



GetIM(self)

Returns an immutable representation of the wx.Point2D object, based on namedtuple.

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.Point2D with 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:

wx.Point



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

Floor

See GetFloor



IM

See GetIM



Rounded

See GetRounded



VectorAngle

See GetVectorAngle and SetVectorAngle



VectorLength

See GetVectorLength and SetVectorLength



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.