Point
Source code in gdsr/_gdsr.pyi
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
__init__
Initialize the Point with x and y coordinates.
Parameters:
-
x
(float
) –x coordinate
-
y
(float
) –y coordinate
distance_to
distance_to(other: PointLike) -> float
cross
cross(other: PointLike) -> float
copy
rotate
rotate(angle: float, centre: PointLike = Point(0, 0)) -> Self
Rotates the point by an angle around a centre point.
Parameters:
-
angle
(float
) –Counter-clockwise rotation angle in degrees.
-
centre
(PointLike
, default:Point(0, 0)
) –Centre point of rotation, defaults to Point(0, 0).
Source code in gdsr/_gdsr.pyi
scale
scale(factor: float, centre: PointLike = Point(0, 0)) -> Self
Scales the point by a factor around a centre point.
Parameters:
-
factor
(float
) –Scaling factor.
-
centre
(PointLike
, default:Point(0, 0)
) –Centre point of scaling, defaults to Point(0, 0).
round
Return the point with rounded coordinates.
Parameters:
-
digits
(int
, default:0
) –Number of digits to round to, defaults to None.
angle_to
angle_to(other: PointLike) -> float | None
Return the angle to another point in degrees.
The angle is measured counter-clockwise from the x-axis and is in the range of 0 to 360 degrees.
Return None if the points are the same.
Parameters:
-
other
(PointLike
) –The other point.
Source code in gdsr/_gdsr.pyi
is_close
is_close(other: PointLike, rel_tol: float = 1e-07, abs_tol: float = 1e-10) -> bool
Return True if the point is close to another point.
Parameters:
-
other
(PointLike
) –The other point.
-
rel_tol
(float
, default:1e-07
) –Relative tolerance, defaults to 1e-9.
-
abs_tol
(float
, default:1e-10
) –Absolute tolerance, defaults to 0.0.
Source code in gdsr/_gdsr.pyi
epsilon_is_close
epsilon_is_close(other: PointLike) -> bool
Return True if the point is close to another point using epsilon.
This is used in all equality checks in gdsr.
Parameters:
-
other
(PointLike
) –The other point.
reflect
reflect(angle: float, centre: PointLike = Point(0, 0)) -> Self
Reflect the point across a line defined by an angle around a centre point.
Parameters:
-
angle
(float
) –Angle of the line in degrees.
-
centre
(PointLike
, default:Point(0, 0)
) –Centre point of reflection, defaults to Point(0, 0).
Source code in gdsr/_gdsr.pyi
__getitem__
__bool__
__repr__
__str__
__add__
__add__(other: PointLike) -> Self
__radd__
__radd__(other: PointLike) -> Self
__sub__
__sub__(other: PointLike) -> Self
__rsub__
__rsub__(other: PointLike) -> Self