Point#
Point represents a point in the plane, defined by its x and y coordinates.
Attribute / Method |
Description |
|---|---|
Calculate distance to point or rect |
|
Transform point with a matrix |
|
Same as unit, but positive coordinates |
|
Point coordinates divided by abs(point) |
|
The X-coordinate |
|
The Y-coordinate |
Class API
- class Point#
- Point()#
- Point(float x, float y)#
- Point(Point point)#
- Point(FzPoint point)#
Overloaded constructors.
Without parameters, Point(0, 0) will be created.
With another point or FzPoint specified, a new copy will be created.
- Parameters:
x (float) – x coordinate of the point
y (float) – y coordinate of the point
- DistanceTo(Point x, string unit)#
- DistanceTo(Rect x, string unit)#
- Parameters:
- Return type:
float
- Returns:
the distance to x. If this is
Rect, then the distanceis the length of the shortest line connecting to one of the rectangle sides
is calculated to the finite version of it
is zero if it contains the point
- Transform(m)#
Apply a matrix to the point and replace it with the result.
- Parameters:
m (matrix_like) – The matrix to be applied.
- Return type:
- Unit#
Result of dividing each coordinate by norm(point), the distance of the point to (0,0). This is a vector of length 1 pointing in the same direction as the point does. Its x, resp. y values are equal to the cosine, resp. sine of the angle this vector (and the point itself) has with the x axis.
- Type:
- X#
The x coordinate
- Type:
float
- Y#
The y coordinate
- Type:
float
