open-space-toolkit-mathematics 4.6.0__py39-none-manylinux2014_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- open_space_toolkit_mathematics-4.6.0.dist-info/METADATA +28 -0
- open_space_toolkit_mathematics-4.6.0.dist-info/RECORD +68 -0
- open_space_toolkit_mathematics-4.6.0.dist-info/WHEEL +5 -0
- open_space_toolkit_mathematics-4.6.0.dist-info/top_level.txt +1 -0
- open_space_toolkit_mathematics-4.6.0.dist-info/zip-safe +1 -0
- ostk/__init__.py +1 -0
- ostk/mathematics/OpenSpaceToolkitMathematicsPy.cpython-39-aarch64-linux-gnu.so +0 -0
- ostk/mathematics/__init__.py +5 -0
- ostk/mathematics/__init__.pyi +11 -0
- ostk/mathematics/curve_fitting/__init__.pyi +155 -0
- ostk/mathematics/curve_fitting/interpolator.pyi +243 -0
- ostk/mathematics/geometry/__init__.pyi +504 -0
- ostk/mathematics/geometry/d2/__init__.pyi +809 -0
- ostk/mathematics/geometry/d2/object.pyi +1779 -0
- ostk/mathematics/geometry/d3/__init__.pyi +1032 -0
- ostk/mathematics/geometry/d3/object.pyi +3709 -0
- ostk/mathematics/geometry/d3/transformation/__init__.pyi +3 -0
- ostk/mathematics/geometry/d3/transformation/rotation.pyi +1358 -0
- ostk/mathematics/libopen-space-toolkit-mathematics.so.4 +0 -0
- ostk/mathematics/object.pyi +387 -0
- ostk/mathematics/solver.pyi +342 -0
- ostk/mathematics/test/__init__.py +1 -0
- ostk/mathematics/test/curve_fitting/__init__.py +1 -0
- ostk/mathematics/test/curve_fitting/interpolator/__init__.py +1 -0
- ostk/mathematics/test/curve_fitting/interpolator/test_barycentric_rational.py +44 -0
- ostk/mathematics/test/curve_fitting/interpolator/test_cubic_spline.py +55 -0
- ostk/mathematics/test/curve_fitting/interpolator/test_interpolator.py +71 -0
- ostk/mathematics/test/curve_fitting/interpolator/test_linear.py +45 -0
- ostk/mathematics/test/geometry/__init__.py +1 -0
- ostk/mathematics/test/geometry/d2/__init__.py +1 -0
- ostk/mathematics/test/geometry/d2/conftest.py +79 -0
- ostk/mathematics/test/geometry/d2/object/__init__.py +1 -0
- ostk/mathematics/test/geometry/d2/object/test_composite.py +93 -0
- ostk/mathematics/test/geometry/d2/object/test_line.py +57 -0
- ostk/mathematics/test/geometry/d2/object/test_linestring.py +174 -0
- ostk/mathematics/test/geometry/d2/object/test_multipolygon.py +94 -0
- ostk/mathematics/test/geometry/d2/object/test_point.py +213 -0
- ostk/mathematics/test/geometry/d2/object/test_point_set.py +100 -0
- ostk/mathematics/test/geometry/d2/object/test_polygon.py +370 -0
- ostk/mathematics/test/geometry/d2/object/test_segment.py +104 -0
- ostk/mathematics/test/geometry/d2/test_object.py +25 -0
- ostk/mathematics/test/geometry/d2/test_transformation.py +84 -0
- ostk/mathematics/test/geometry/d3/__init__.py +1 -0
- ostk/mathematics/test/geometry/d3/object/__init__.py +1 -0
- ostk/mathematics/test/geometry/d3/object/test_composite.py +262 -0
- ostk/mathematics/test/geometry/d3/object/test_cuboid.py +20 -0
- ostk/mathematics/test/geometry/d3/object/test_line.py +68 -0
- ostk/mathematics/test/geometry/d3/object/test_linestring.py +168 -0
- ostk/mathematics/test/geometry/d3/object/test_point.py +234 -0
- ostk/mathematics/test/geometry/d3/object/test_point_set.py +113 -0
- ostk/mathematics/test/geometry/d3/object/test_polygon.py +141 -0
- ostk/mathematics/test/geometry/d3/object/test_segment.py +120 -0
- ostk/mathematics/test/geometry/d3/objects/test_cuboid.py +20 -0
- ostk/mathematics/test/geometry/d3/test_intersection.py +3 -0
- ostk/mathematics/test/geometry/d3/test_object.py +3 -0
- ostk/mathematics/test/geometry/d3/test_transformation.py +3 -0
- ostk/mathematics/test/geometry/d3/transformation/__init__.py +1 -0
- ostk/mathematics/test/geometry/d3/transformation/rotation/__init__.py +1 -0
- ostk/mathematics/test/geometry/d3/transformation/rotation/test_euler_angle.py +138 -0
- ostk/mathematics/test/geometry/d3/transformation/rotation/test_quaternion.py +189 -0
- ostk/mathematics/test/geometry/d3/transformation/rotation/test_rotation_matrix.py +40 -0
- ostk/mathematics/test/geometry/d3/transformation/rotation/test_rotation_vector.py +47 -0
- ostk/mathematics/test/geometry/test_angle.py +345 -0
- ostk/mathematics/test/object/__init__.py +1 -0
- ostk/mathematics/test/object/test_interval.py +515 -0
- ostk/mathematics/test/object/test_vector.py +5 -0
- ostk/mathematics/test/solver/test_numerical_solver.py +176 -0
- ostk/mathematics/test/test_object.py +24 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import numpy
|
|
3
|
+
import ostk.core.type
|
|
4
|
+
import typing
|
|
5
|
+
from . import d2
|
|
6
|
+
from . import d3
|
|
7
|
+
__all__ = ['Angle', 'd2', 'd3']
|
|
8
|
+
class Angle:
|
|
9
|
+
class Unit:
|
|
10
|
+
"""
|
|
11
|
+
Members:
|
|
12
|
+
|
|
13
|
+
Undefined
|
|
14
|
+
|
|
15
|
+
Radian
|
|
16
|
+
|
|
17
|
+
Degree
|
|
18
|
+
|
|
19
|
+
Arcminute
|
|
20
|
+
|
|
21
|
+
Arcsecond
|
|
22
|
+
|
|
23
|
+
Revolution
|
|
24
|
+
"""
|
|
25
|
+
Arcminute: typing.ClassVar[Angle.Unit] # value = <Unit.Arcminute: 3>
|
|
26
|
+
Arcsecond: typing.ClassVar[Angle.Unit] # value = <Unit.Arcsecond: 4>
|
|
27
|
+
Degree: typing.ClassVar[Angle.Unit] # value = <Unit.Degree: 2>
|
|
28
|
+
Radian: typing.ClassVar[Angle.Unit] # value = <Unit.Radian: 1>
|
|
29
|
+
Revolution: typing.ClassVar[Angle.Unit] # value = <Unit.Revolution: 5>
|
|
30
|
+
Undefined: typing.ClassVar[Angle.Unit] # value = <Unit.Undefined: 0>
|
|
31
|
+
__members__: typing.ClassVar[dict[str, Angle.Unit]] # value = {'Undefined': <Unit.Undefined: 0>, 'Radian': <Unit.Radian: 1>, 'Degree': <Unit.Degree: 2>, 'Arcminute': <Unit.Arcminute: 3>, 'Arcsecond': <Unit.Arcsecond: 4>, 'Revolution': <Unit.Revolution: 5>}
|
|
32
|
+
def __eq__(self, other: typing.Any) -> bool:
|
|
33
|
+
...
|
|
34
|
+
def __getstate__(self) -> int:
|
|
35
|
+
...
|
|
36
|
+
def __hash__(self) -> int:
|
|
37
|
+
...
|
|
38
|
+
def __index__(self) -> int:
|
|
39
|
+
...
|
|
40
|
+
def __init__(self, value: int) -> None:
|
|
41
|
+
...
|
|
42
|
+
def __int__(self) -> int:
|
|
43
|
+
...
|
|
44
|
+
def __ne__(self, other: typing.Any) -> bool:
|
|
45
|
+
...
|
|
46
|
+
def __repr__(self) -> str:
|
|
47
|
+
...
|
|
48
|
+
def __setstate__(self, state: int) -> None:
|
|
49
|
+
...
|
|
50
|
+
def __str__(self) -> str:
|
|
51
|
+
...
|
|
52
|
+
@property
|
|
53
|
+
def name(self) -> str:
|
|
54
|
+
...
|
|
55
|
+
@property
|
|
56
|
+
def value(self) -> int:
|
|
57
|
+
...
|
|
58
|
+
__hash__: typing.ClassVar[None] = None
|
|
59
|
+
@staticmethod
|
|
60
|
+
def arcminutes(value: ostk.core.type.Real) -> Angle:
|
|
61
|
+
"""
|
|
62
|
+
Create an angle from a value in arcminutes.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
value (float): The angle value in arcminutes.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
Angle: An angle with the specified value in arcminutes.
|
|
69
|
+
|
|
70
|
+
Example:
|
|
71
|
+
>>> angle = Angle.arcminutes(60.0)
|
|
72
|
+
>>> angle.in_degrees() # 1.0
|
|
73
|
+
"""
|
|
74
|
+
@staticmethod
|
|
75
|
+
def arcseconds(value: ostk.core.type.Real) -> Angle:
|
|
76
|
+
"""
|
|
77
|
+
Create an angle from a value in arcseconds.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
value (float): The angle value in arcseconds.
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
Angle: An angle with the specified value in arcseconds.
|
|
84
|
+
|
|
85
|
+
Example:
|
|
86
|
+
>>> angle = Angle.arcseconds(3600.0)
|
|
87
|
+
>>> angle.in_degrees() # 1.0
|
|
88
|
+
"""
|
|
89
|
+
@staticmethod
|
|
90
|
+
@typing.overload
|
|
91
|
+
def between(first_vector: numpy.ndarray[numpy.float64[2, 1]], second_vector: numpy.ndarray[numpy.float64[2, 1]]) -> Angle:
|
|
92
|
+
"""
|
|
93
|
+
Calculate the angle between two 2D vectors.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
first_vector (np.array): The first vector.
|
|
97
|
+
second_vector (np.array): The second vector.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
Angle: The angle between the vectors.
|
|
101
|
+
|
|
102
|
+
Example:
|
|
103
|
+
>>> v1 = np.array([1.0, 0.0])
|
|
104
|
+
>>> v2 = np.array([0.0, 1.0])
|
|
105
|
+
>>> angle = Angle.between(v1, v2)
|
|
106
|
+
>>> angle.in_degrees() # 90.0
|
|
107
|
+
"""
|
|
108
|
+
@staticmethod
|
|
109
|
+
@typing.overload
|
|
110
|
+
def between(first_vector: numpy.ndarray[numpy.float64[3, 1]], second_vector: numpy.ndarray[numpy.float64[3, 1]]) -> Angle:
|
|
111
|
+
"""
|
|
112
|
+
Calculate the angle between two 3D vectors.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
first_vector (np.array): The first vector.
|
|
116
|
+
second_vector (np.array): The second vector.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
Angle: The angle between the vectors.
|
|
120
|
+
|
|
121
|
+
Example:
|
|
122
|
+
>>> v1 = np.array([1.0, 0.0, 0.0])
|
|
123
|
+
>>> v2 = np.array([0.0, 1.0, 0.0])
|
|
124
|
+
>>> angle = Angle.between(v1, v2)
|
|
125
|
+
>>> angle.in_degrees() # 90.0
|
|
126
|
+
"""
|
|
127
|
+
@staticmethod
|
|
128
|
+
def degrees(value: ostk.core.type.Real) -> Angle:
|
|
129
|
+
"""
|
|
130
|
+
Create an angle from a value in degrees.
|
|
131
|
+
|
|
132
|
+
Args:
|
|
133
|
+
value (float): The angle value in degrees.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Angle: An angle with the specified value in degrees.
|
|
137
|
+
|
|
138
|
+
Example:
|
|
139
|
+
>>> angle = Angle.degrees(180.0)
|
|
140
|
+
>>> angle.in_radians() # ~3.14159
|
|
141
|
+
"""
|
|
142
|
+
@staticmethod
|
|
143
|
+
def half_pi() -> Angle:
|
|
144
|
+
"""
|
|
145
|
+
Create an angle of π/2 radians (90 degrees).
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
Angle: An angle of π/2 radians.
|
|
149
|
+
|
|
150
|
+
Example:
|
|
151
|
+
>>> half_pi = Angle.half_pi()
|
|
152
|
+
>>> half_pi.in_degrees() # 90.0
|
|
153
|
+
"""
|
|
154
|
+
@staticmethod
|
|
155
|
+
def pi() -> Angle:
|
|
156
|
+
"""
|
|
157
|
+
Create an angle of π radians (180 degrees).
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
Angle: An angle of π radians.
|
|
161
|
+
|
|
162
|
+
Example:
|
|
163
|
+
>>> pi = Angle.pi()
|
|
164
|
+
>>> pi.in_degrees() # 180.0
|
|
165
|
+
"""
|
|
166
|
+
@staticmethod
|
|
167
|
+
def radians(value: ostk.core.type.Real) -> Angle:
|
|
168
|
+
"""
|
|
169
|
+
Create an angle from a value in radians.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
value (float): The angle value in radians.
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
Angle: An angle with the specified value in radians.
|
|
176
|
+
|
|
177
|
+
Example:
|
|
178
|
+
>>> angle = Angle.radians(3.14159)
|
|
179
|
+
>>> angle.in_degrees() # ~180.0
|
|
180
|
+
"""
|
|
181
|
+
@staticmethod
|
|
182
|
+
def revolutions(value: ostk.core.type.Real) -> Angle:
|
|
183
|
+
"""
|
|
184
|
+
Create an angle from a value in revolutions.
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
value (float): The angle value in revolutions.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
Angle: An angle with the specified value in revolutions.
|
|
191
|
+
|
|
192
|
+
Example:
|
|
193
|
+
>>> angle = Angle.revolutions(1.0)
|
|
194
|
+
>>> angle.in_degrees() # 360.0
|
|
195
|
+
"""
|
|
196
|
+
@staticmethod
|
|
197
|
+
def string_from_unit(unit: typing.Any) -> ostk.core.type.String:
|
|
198
|
+
"""
|
|
199
|
+
Get the string representation of an angle unit.
|
|
200
|
+
|
|
201
|
+
Args:
|
|
202
|
+
unit (Angle.Unit): The angle unit.
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
str: String representation of the unit.
|
|
206
|
+
|
|
207
|
+
Example:
|
|
208
|
+
>>> Angle.string_from_unit(Angle.Unit.Degree) # "Degree"
|
|
209
|
+
"""
|
|
210
|
+
@staticmethod
|
|
211
|
+
def symbol_from_unit(unit: typing.Any) -> ostk.core.type.String:
|
|
212
|
+
"""
|
|
213
|
+
Get the symbol representation of an angle unit.
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
unit (Angle.Unit): The angle unit.
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
str: Symbol representation of the unit.
|
|
220
|
+
|
|
221
|
+
Example:
|
|
222
|
+
>>> Angle.symbol_from_unit(Angle.Unit.Degree) # "deg"
|
|
223
|
+
>>> Angle.symbol_from_unit(Angle.Unit.Radian) # "rad"
|
|
224
|
+
"""
|
|
225
|
+
@staticmethod
|
|
226
|
+
def two_pi() -> Angle:
|
|
227
|
+
"""
|
|
228
|
+
Create an angle of 2π radians (360 degrees).
|
|
229
|
+
|
|
230
|
+
Returns:
|
|
231
|
+
Angle: An angle of 2π radians.
|
|
232
|
+
|
|
233
|
+
Example:
|
|
234
|
+
>>> two_pi = Angle.two_pi()
|
|
235
|
+
>>> two_pi.in_degrees() # 360.0
|
|
236
|
+
"""
|
|
237
|
+
@staticmethod
|
|
238
|
+
def undefined() -> Angle:
|
|
239
|
+
"""
|
|
240
|
+
Create an undefined angle.
|
|
241
|
+
|
|
242
|
+
Returns:
|
|
243
|
+
Angle: An undefined angle.
|
|
244
|
+
|
|
245
|
+
Example:
|
|
246
|
+
>>> undefined_angle = Angle.undefined()
|
|
247
|
+
>>> undefined_angle.is_defined() # False
|
|
248
|
+
"""
|
|
249
|
+
@staticmethod
|
|
250
|
+
def zero() -> Angle:
|
|
251
|
+
"""
|
|
252
|
+
Create a zero angle.
|
|
253
|
+
|
|
254
|
+
Returns:
|
|
255
|
+
Angle: A zero angle (0 radians).
|
|
256
|
+
|
|
257
|
+
Example:
|
|
258
|
+
>>> zero_angle = Angle.zero()
|
|
259
|
+
>>> zero_angle.is_zero() # True
|
|
260
|
+
"""
|
|
261
|
+
def __add__(self, arg0: Angle) -> Angle:
|
|
262
|
+
...
|
|
263
|
+
def __eq__(self, arg0: Angle) -> bool:
|
|
264
|
+
...
|
|
265
|
+
def __iadd__(self, arg0: Angle) -> Angle:
|
|
266
|
+
...
|
|
267
|
+
def __imul__(self, arg0: ostk.core.type.Real) -> Angle:
|
|
268
|
+
...
|
|
269
|
+
def __init__(self, value: ostk.core.type.Real, unit: typing.Any) -> None:
|
|
270
|
+
"""
|
|
271
|
+
Create an angle with specified value and unit.
|
|
272
|
+
|
|
273
|
+
Args:
|
|
274
|
+
value (float): The numerical value of the angle.
|
|
275
|
+
unit (Angle.Unit): The unit of the angle (Radian, Degree, etc.).
|
|
276
|
+
|
|
277
|
+
Example:
|
|
278
|
+
>>> angle = Angle(3.14159, Angle.Unit.Radian)
|
|
279
|
+
>>> angle = Angle(180.0, Angle.Unit.Degree)
|
|
280
|
+
"""
|
|
281
|
+
def __isub__(self, arg0: Angle) -> Angle:
|
|
282
|
+
...
|
|
283
|
+
def __itruediv__(self, arg0: ostk.core.type.Real) -> Angle:
|
|
284
|
+
...
|
|
285
|
+
def __mul__(self, arg0: ostk.core.type.Real) -> Angle:
|
|
286
|
+
...
|
|
287
|
+
def __ne__(self, arg0: Angle) -> bool:
|
|
288
|
+
...
|
|
289
|
+
def __neg__(self) -> Angle:
|
|
290
|
+
...
|
|
291
|
+
def __pos__(self) -> Angle:
|
|
292
|
+
...
|
|
293
|
+
def __repr__(self) -> str:
|
|
294
|
+
...
|
|
295
|
+
def __str__(self) -> str:
|
|
296
|
+
...
|
|
297
|
+
def __sub__(self, arg0: Angle) -> Angle:
|
|
298
|
+
...
|
|
299
|
+
def __truediv__(self, arg0: ostk.core.type.Real) -> Angle:
|
|
300
|
+
...
|
|
301
|
+
def get_unit(self) -> ...:
|
|
302
|
+
"""
|
|
303
|
+
Get the unit of the angle.
|
|
304
|
+
|
|
305
|
+
Returns:
|
|
306
|
+
Angle.Unit: The unit of the angle.
|
|
307
|
+
|
|
308
|
+
Example:
|
|
309
|
+
>>> angle = Angle.degrees(90.0)
|
|
310
|
+
>>> angle.get_unit() # Angle.Unit.Degree
|
|
311
|
+
"""
|
|
312
|
+
@typing.overload
|
|
313
|
+
def in_arcminutes(self) -> ostk.core.type.Real:
|
|
314
|
+
"""
|
|
315
|
+
Get the angle value in arcminutes.
|
|
316
|
+
|
|
317
|
+
Returns:
|
|
318
|
+
float: The angle value in arcminutes.
|
|
319
|
+
|
|
320
|
+
Example:
|
|
321
|
+
>>> angle = Angle.degrees(1.0)
|
|
322
|
+
>>> angle.in_arcminutes() # 60.0
|
|
323
|
+
"""
|
|
324
|
+
@typing.overload
|
|
325
|
+
def in_arcminutes(self, lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> ostk.core.type.Real:
|
|
326
|
+
"""
|
|
327
|
+
Get the angle value in arcminutes within specified bounds.
|
|
328
|
+
|
|
329
|
+
Args:
|
|
330
|
+
lower_bound (float): The lower bound in arcminutes.
|
|
331
|
+
upper_bound (float): The upper bound in arcminutes.
|
|
332
|
+
|
|
333
|
+
Returns:
|
|
334
|
+
float: The angle value in arcminutes, wrapped within bounds.
|
|
335
|
+
"""
|
|
336
|
+
@typing.overload
|
|
337
|
+
def in_arcseconds(self) -> ostk.core.type.Real:
|
|
338
|
+
"""
|
|
339
|
+
Get the angle value in arcseconds.
|
|
340
|
+
|
|
341
|
+
Returns:
|
|
342
|
+
float: The angle value in arcseconds.
|
|
343
|
+
|
|
344
|
+
Example:
|
|
345
|
+
>>> angle = Angle.degrees(1.0)
|
|
346
|
+
>>> angle.in_arcseconds() # 3600.0
|
|
347
|
+
"""
|
|
348
|
+
@typing.overload
|
|
349
|
+
def in_arcseconds(self, lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> ostk.core.type.Real:
|
|
350
|
+
"""
|
|
351
|
+
Get the angle value in arcseconds within specified bounds.
|
|
352
|
+
|
|
353
|
+
Args:
|
|
354
|
+
lower_bound (float): The lower bound in arcseconds.
|
|
355
|
+
upper_bound (float): The upper bound in arcseconds.
|
|
356
|
+
|
|
357
|
+
Returns:
|
|
358
|
+
float: The angle value in arcseconds, wrapped within bounds.
|
|
359
|
+
"""
|
|
360
|
+
@typing.overload
|
|
361
|
+
def in_degrees(self) -> ostk.core.type.Real:
|
|
362
|
+
"""
|
|
363
|
+
Get the angle value in degrees.
|
|
364
|
+
|
|
365
|
+
Returns:
|
|
366
|
+
float: The angle value in degrees.
|
|
367
|
+
|
|
368
|
+
Example:
|
|
369
|
+
>>> angle = Angle.radians(3.14159)
|
|
370
|
+
>>> angle.in_degrees() # ~180.0
|
|
371
|
+
"""
|
|
372
|
+
@typing.overload
|
|
373
|
+
def in_degrees(self, lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> ostk.core.type.Real:
|
|
374
|
+
"""
|
|
375
|
+
Get the angle value in degrees within specified bounds.
|
|
376
|
+
|
|
377
|
+
Args:
|
|
378
|
+
lower_bound (float): The lower bound in degrees.
|
|
379
|
+
upper_bound (float): The upper bound in degrees.
|
|
380
|
+
|
|
381
|
+
Returns:
|
|
382
|
+
float: The angle value in degrees, wrapped within bounds.
|
|
383
|
+
|
|
384
|
+
Example:
|
|
385
|
+
>>> angle = Angle.degrees(450.0)
|
|
386
|
+
>>> angle.in_degrees(-180.0, 180.0) # 90.0
|
|
387
|
+
"""
|
|
388
|
+
@typing.overload
|
|
389
|
+
def in_radians(self) -> ostk.core.type.Real:
|
|
390
|
+
"""
|
|
391
|
+
Get the angle value in radians.
|
|
392
|
+
|
|
393
|
+
Returns:
|
|
394
|
+
float: The angle value in radians.
|
|
395
|
+
|
|
396
|
+
Example:
|
|
397
|
+
>>> angle = Angle.degrees(180.0)
|
|
398
|
+
>>> angle.in_radians() # ~3.14159
|
|
399
|
+
"""
|
|
400
|
+
@typing.overload
|
|
401
|
+
def in_radians(self, lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> ostk.core.type.Real:
|
|
402
|
+
"""
|
|
403
|
+
Get the angle value in radians within specified bounds.
|
|
404
|
+
|
|
405
|
+
Args:
|
|
406
|
+
lower_bound (float): The lower bound in radians.
|
|
407
|
+
upper_bound (float): The upper bound in radians.
|
|
408
|
+
|
|
409
|
+
Returns:
|
|
410
|
+
float: The angle value in radians, wrapped within bounds.
|
|
411
|
+
|
|
412
|
+
Example:
|
|
413
|
+
>>> angle = Angle.radians(7.0)
|
|
414
|
+
>>> angle.in_radians(-3.14159, 3.14159) # Wrapped to [-π, π]
|
|
415
|
+
"""
|
|
416
|
+
def in_revolutions(self) -> ostk.core.type.Real:
|
|
417
|
+
"""
|
|
418
|
+
Get the angle value in revolutions.
|
|
419
|
+
|
|
420
|
+
Returns:
|
|
421
|
+
float: The angle value in revolutions.
|
|
422
|
+
|
|
423
|
+
Example:
|
|
424
|
+
>>> angle = Angle.degrees(360.0)
|
|
425
|
+
>>> angle.in_revolutions() # 1.0
|
|
426
|
+
"""
|
|
427
|
+
def in_unit(self, unit: typing.Any) -> ostk.core.type.Real:
|
|
428
|
+
"""
|
|
429
|
+
Get the angle value in a specific unit.
|
|
430
|
+
|
|
431
|
+
Args:
|
|
432
|
+
unit (Angle.Unit): The unit to convert to.
|
|
433
|
+
|
|
434
|
+
Returns:
|
|
435
|
+
float: The angle value in the specified unit.
|
|
436
|
+
|
|
437
|
+
Example:
|
|
438
|
+
>>> angle = Angle.degrees(180.0)
|
|
439
|
+
>>> angle.in_unit(Angle.Unit.Radian) # ~3.14159
|
|
440
|
+
"""
|
|
441
|
+
def is_defined(self) -> bool:
|
|
442
|
+
"""
|
|
443
|
+
Check if the angle is defined.
|
|
444
|
+
|
|
445
|
+
Returns:
|
|
446
|
+
bool: True if the angle is defined, False otherwise.
|
|
447
|
+
|
|
448
|
+
Example:
|
|
449
|
+
>>> angle = Angle.radians(1.0)
|
|
450
|
+
>>> angle.is_defined() # True
|
|
451
|
+
"""
|
|
452
|
+
def is_near(self, angle: Angle, tolerance: Angle) -> bool:
|
|
453
|
+
"""
|
|
454
|
+
Check if this angle is near another angle within a tolerance.
|
|
455
|
+
|
|
456
|
+
Args:
|
|
457
|
+
angle (Angle): The angle to compare with.
|
|
458
|
+
tolerance (Angle): The tolerance for comparison.
|
|
459
|
+
|
|
460
|
+
Returns:
|
|
461
|
+
bool: True if angles are within tolerance, False otherwise.
|
|
462
|
+
|
|
463
|
+
Example:
|
|
464
|
+
>>> angle1 = Angle.degrees(30.0)
|
|
465
|
+
>>> angle2 = Angle.degrees(30.1)
|
|
466
|
+
>>> tolerance = Angle.degrees(0.2)
|
|
467
|
+
>>> angle1.is_near(angle2, tolerance) # True
|
|
468
|
+
"""
|
|
469
|
+
def is_negative(self) -> bool:
|
|
470
|
+
"""
|
|
471
|
+
Check if the angle is negative.
|
|
472
|
+
|
|
473
|
+
Returns:
|
|
474
|
+
bool: True if the angle is negative, False otherwise.
|
|
475
|
+
|
|
476
|
+
Example:
|
|
477
|
+
>>> angle = Angle.degrees(-30.0)
|
|
478
|
+
>>> angle.is_negative() # True
|
|
479
|
+
"""
|
|
480
|
+
def is_zero(self) -> bool:
|
|
481
|
+
"""
|
|
482
|
+
Check if the angle is zero.
|
|
483
|
+
|
|
484
|
+
Returns:
|
|
485
|
+
bool: True if the angle is zero, False otherwise.
|
|
486
|
+
|
|
487
|
+
Example:
|
|
488
|
+
>>> angle = Angle.zero()
|
|
489
|
+
>>> angle.is_zero() # True
|
|
490
|
+
"""
|
|
491
|
+
def to_string(self, precision: ostk.core.type.Integer = ...) -> ostk.core.type.String:
|
|
492
|
+
"""
|
|
493
|
+
Convert the angle to a string representation.
|
|
494
|
+
|
|
495
|
+
Args:
|
|
496
|
+
precision (int, optional): The precision for floating point numbers. Defaults to Integer.undefined().
|
|
497
|
+
|
|
498
|
+
Returns:
|
|
499
|
+
str: String representation of the angle.
|
|
500
|
+
|
|
501
|
+
Example:
|
|
502
|
+
>>> angle = Angle.degrees(90.0)
|
|
503
|
+
>>> angle.to_string() # "90.0 [deg]"
|
|
504
|
+
"""
|