Point¶
- class Point(radius: float = 0, azimuth: float = 0, center_of_projection: Point | None = None, needs_center_of_projection: bool = True, is_relative: bool = False)[source]¶
Represent a point in the hyperbolic plane using polar coordinates.
- Parameters:
By default is_relative is False, meaning when converting the receiver to a point in the Euclidean plane, we first determine its coordinates relative to its center of projection and only then correct the point in Euclidean space. When is_relative is True, we do NOT determine the coordinates relative to the center of projection (since we assume that the point is relative already), and correct the point in Euclidean space as is. This can be useful as some classes like
Circle
deal with the projection themselves and only need the correction.- distance_to(other, curvature: float = -1) float [source]¶
Returns the hyperbolic distance between the receiver and the other
Point
.
- get_projection_relative_point() Point [source]¶
Returns a
Point
whose coordinates represent the ones of the receiver, but as if its center of projection was the origin.
- static normalize_angle(angle: float) float [source]¶
Given an angle in radians, returns the equivalent angle in [0, 2 PI].
- rotated_by(angle: float) Point [source]¶
Rotates the receiver around the origin by the passed angle in radians.
- set_center_of_projection(point: Point | None) Point [source]¶
Changes the center of projection of the receiver.
- to_point_in_plane(plane: PolarPlane) ndarray[tuple[int, ...], dtype[float64]] [source]¶
Converts the receiver to a canvas
Point2D
, assuming that it lies in the passedPolarPlane
.
- translated_by(distance: float, curvature: float = -1) Point [source]¶
This translation represents a movement of a point from the origin along the x-axis by a specified distance. All other points in the plane, in particular the receiver
Point
, are moved in such a way, that the distance to the moving point remain unchanged.- Note
Does not actually move the other objects in the plane. But only the receiver.