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.
Files changed (68) hide show
  1. open_space_toolkit_mathematics-4.6.0.dist-info/METADATA +28 -0
  2. open_space_toolkit_mathematics-4.6.0.dist-info/RECORD +68 -0
  3. open_space_toolkit_mathematics-4.6.0.dist-info/WHEEL +5 -0
  4. open_space_toolkit_mathematics-4.6.0.dist-info/top_level.txt +1 -0
  5. open_space_toolkit_mathematics-4.6.0.dist-info/zip-safe +1 -0
  6. ostk/__init__.py +1 -0
  7. ostk/mathematics/OpenSpaceToolkitMathematicsPy.cpython-39-aarch64-linux-gnu.so +0 -0
  8. ostk/mathematics/__init__.py +5 -0
  9. ostk/mathematics/__init__.pyi +11 -0
  10. ostk/mathematics/curve_fitting/__init__.pyi +155 -0
  11. ostk/mathematics/curve_fitting/interpolator.pyi +243 -0
  12. ostk/mathematics/geometry/__init__.pyi +504 -0
  13. ostk/mathematics/geometry/d2/__init__.pyi +809 -0
  14. ostk/mathematics/geometry/d2/object.pyi +1779 -0
  15. ostk/mathematics/geometry/d3/__init__.pyi +1032 -0
  16. ostk/mathematics/geometry/d3/object.pyi +3709 -0
  17. ostk/mathematics/geometry/d3/transformation/__init__.pyi +3 -0
  18. ostk/mathematics/geometry/d3/transformation/rotation.pyi +1358 -0
  19. ostk/mathematics/libopen-space-toolkit-mathematics.so.4 +0 -0
  20. ostk/mathematics/object.pyi +387 -0
  21. ostk/mathematics/solver.pyi +342 -0
  22. ostk/mathematics/test/__init__.py +1 -0
  23. ostk/mathematics/test/curve_fitting/__init__.py +1 -0
  24. ostk/mathematics/test/curve_fitting/interpolator/__init__.py +1 -0
  25. ostk/mathematics/test/curve_fitting/interpolator/test_barycentric_rational.py +44 -0
  26. ostk/mathematics/test/curve_fitting/interpolator/test_cubic_spline.py +55 -0
  27. ostk/mathematics/test/curve_fitting/interpolator/test_interpolator.py +71 -0
  28. ostk/mathematics/test/curve_fitting/interpolator/test_linear.py +45 -0
  29. ostk/mathematics/test/geometry/__init__.py +1 -0
  30. ostk/mathematics/test/geometry/d2/__init__.py +1 -0
  31. ostk/mathematics/test/geometry/d2/conftest.py +79 -0
  32. ostk/mathematics/test/geometry/d2/object/__init__.py +1 -0
  33. ostk/mathematics/test/geometry/d2/object/test_composite.py +93 -0
  34. ostk/mathematics/test/geometry/d2/object/test_line.py +57 -0
  35. ostk/mathematics/test/geometry/d2/object/test_linestring.py +174 -0
  36. ostk/mathematics/test/geometry/d2/object/test_multipolygon.py +94 -0
  37. ostk/mathematics/test/geometry/d2/object/test_point.py +213 -0
  38. ostk/mathematics/test/geometry/d2/object/test_point_set.py +100 -0
  39. ostk/mathematics/test/geometry/d2/object/test_polygon.py +370 -0
  40. ostk/mathematics/test/geometry/d2/object/test_segment.py +104 -0
  41. ostk/mathematics/test/geometry/d2/test_object.py +25 -0
  42. ostk/mathematics/test/geometry/d2/test_transformation.py +84 -0
  43. ostk/mathematics/test/geometry/d3/__init__.py +1 -0
  44. ostk/mathematics/test/geometry/d3/object/__init__.py +1 -0
  45. ostk/mathematics/test/geometry/d3/object/test_composite.py +262 -0
  46. ostk/mathematics/test/geometry/d3/object/test_cuboid.py +20 -0
  47. ostk/mathematics/test/geometry/d3/object/test_line.py +68 -0
  48. ostk/mathematics/test/geometry/d3/object/test_linestring.py +168 -0
  49. ostk/mathematics/test/geometry/d3/object/test_point.py +234 -0
  50. ostk/mathematics/test/geometry/d3/object/test_point_set.py +113 -0
  51. ostk/mathematics/test/geometry/d3/object/test_polygon.py +141 -0
  52. ostk/mathematics/test/geometry/d3/object/test_segment.py +120 -0
  53. ostk/mathematics/test/geometry/d3/objects/test_cuboid.py +20 -0
  54. ostk/mathematics/test/geometry/d3/test_intersection.py +3 -0
  55. ostk/mathematics/test/geometry/d3/test_object.py +3 -0
  56. ostk/mathematics/test/geometry/d3/test_transformation.py +3 -0
  57. ostk/mathematics/test/geometry/d3/transformation/__init__.py +1 -0
  58. ostk/mathematics/test/geometry/d3/transformation/rotation/__init__.py +1 -0
  59. ostk/mathematics/test/geometry/d3/transformation/rotation/test_euler_angle.py +138 -0
  60. ostk/mathematics/test/geometry/d3/transformation/rotation/test_quaternion.py +189 -0
  61. ostk/mathematics/test/geometry/d3/transformation/rotation/test_rotation_matrix.py +40 -0
  62. ostk/mathematics/test/geometry/d3/transformation/rotation/test_rotation_vector.py +47 -0
  63. ostk/mathematics/test/geometry/test_angle.py +345 -0
  64. ostk/mathematics/test/object/__init__.py +1 -0
  65. ostk/mathematics/test/object/test_interval.py +515 -0
  66. ostk/mathematics/test/object/test_vector.py +5 -0
  67. ostk/mathematics/test/solver/test_numerical_solver.py +176 -0
  68. ostk/mathematics/test/test_object.py +24 -0
@@ -0,0 +1,387 @@
1
+ from __future__ import annotations
2
+ import ostk.core.type
3
+ import typing
4
+ __all__ = ['RealInterval']
5
+ class RealInterval:
6
+ class Type:
7
+ """
8
+ Members:
9
+
10
+ Undefined
11
+
12
+ Closed
13
+
14
+ Open
15
+
16
+ HalfOpenLeft
17
+
18
+ HalfOpenRight
19
+ """
20
+ Closed: typing.ClassVar[RealInterval.Type] # value = <Type.Closed: 1>
21
+ HalfOpenLeft: typing.ClassVar[RealInterval.Type] # value = <Type.HalfOpenLeft: 3>
22
+ HalfOpenRight: typing.ClassVar[RealInterval.Type] # value = <Type.HalfOpenRight: 4>
23
+ Open: typing.ClassVar[RealInterval.Type] # value = <Type.Open: 2>
24
+ Undefined: typing.ClassVar[RealInterval.Type] # value = <Type.Undefined: 0>
25
+ __members__: typing.ClassVar[dict[str, RealInterval.Type]] # value = {'Undefined': <Type.Undefined: 0>, 'Closed': <Type.Closed: 1>, 'Open': <Type.Open: 2>, 'HalfOpenLeft': <Type.HalfOpenLeft: 3>, 'HalfOpenRight': <Type.HalfOpenRight: 4>}
26
+ def __eq__(self, other: typing.Any) -> bool:
27
+ ...
28
+ def __getstate__(self) -> int:
29
+ ...
30
+ def __hash__(self) -> int:
31
+ ...
32
+ def __index__(self) -> int:
33
+ ...
34
+ def __init__(self, value: int) -> None:
35
+ ...
36
+ def __int__(self) -> int:
37
+ ...
38
+ def __ne__(self, other: typing.Any) -> bool:
39
+ ...
40
+ def __repr__(self) -> str:
41
+ ...
42
+ def __setstate__(self, state: int) -> None:
43
+ ...
44
+ def __str__(self) -> str:
45
+ ...
46
+ @property
47
+ def name(self) -> str:
48
+ ...
49
+ @property
50
+ def value(self) -> int:
51
+ ...
52
+ __hash__: typing.ClassVar[None] = None
53
+ @staticmethod
54
+ def clip(intervals: list[RealInterval], clipping_interval: RealInterval) -> list[RealInterval]:
55
+ """
56
+ Clip a list of intervals with a clipping interval.
57
+
58
+ Args:
59
+ intervals (list): List of intervals to clip.
60
+ clipping_interval (RealInterval): The interval to clip with.
61
+
62
+ Returns:
63
+ list: List of clipped intervals.
64
+
65
+ Example:
66
+ >>> intervals = [RealInterval.closed(0.0, 2.0), RealInterval.closed(3.0, 5.0)]
67
+ >>> clipping = RealInterval.closed(1.0, 4.0)
68
+ >>> clipped = RealInterval.clip(intervals, clipping)
69
+ """
70
+ @staticmethod
71
+ def closed(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
72
+ """
73
+ Create a closed interval [a, b].
74
+
75
+ Args:
76
+ lower_bound (float): The lower bound (inclusive).
77
+ upper_bound (float): The upper bound (inclusive).
78
+
79
+ Returns:
80
+ RealInterval: A closed interval.
81
+
82
+ Example:
83
+ >>> interval = RealInterval.closed(0.0, 1.0) # [0, 1]
84
+ >>> interval.contains(0.0) # True
85
+ >>> interval.contains(1.0) # True
86
+ """
87
+ @staticmethod
88
+ def get_gaps(intervals: list[RealInterval], bound: RealInterval = ...) -> list[RealInterval]:
89
+ """
90
+ Find gaps between intervals in a list.
91
+
92
+ Args:
93
+ intervals (list): List of intervals to find gaps between.
94
+ bound (RealInterval, optional): Bounding interval to consider gaps within. Defaults to undefined.
95
+
96
+ Returns:
97
+ list: List of intervals representing gaps.
98
+
99
+ Example:
100
+ >>> intervals = [RealInterval.closed(0.0, 1.0), RealInterval.closed(2.0, 3.0)]
101
+ >>> gaps = RealInterval.get_gaps(intervals) # Gap from 1.0 to 2.0
102
+ """
103
+ @staticmethod
104
+ def half_open_left(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
105
+ """
106
+ Create a half-open interval (a, b].
107
+
108
+ Args:
109
+ lower_bound (float): The lower bound (exclusive).
110
+ upper_bound (float): The upper bound (inclusive).
111
+
112
+ Returns:
113
+ RealInterval: A half-open left interval.
114
+
115
+ Example:
116
+ >>> interval = RealInterval.half_open_left(0.0, 1.0) # (0, 1]
117
+ >>> interval.contains(0.0) # False
118
+ >>> interval.contains(1.0) # True
119
+ """
120
+ @staticmethod
121
+ def half_open_right(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
122
+ """
123
+ Create a half-open interval [a, b).
124
+
125
+ Args:
126
+ lower_bound (float): The lower bound (inclusive).
127
+ upper_bound (float): The upper bound (exclusive).
128
+
129
+ Returns:
130
+ RealInterval: A half-open right interval.
131
+
132
+ Example:
133
+ >>> interval = RealInterval.half_open_right(0.0, 1.0) # [0, 1)
134
+ >>> interval.contains(0.0) # True
135
+ >>> interval.contains(1.0) # False
136
+ """
137
+ @staticmethod
138
+ def logical_and(intervals_1: list[RealInterval], intervals_2: list[RealInterval]) -> list[RealInterval]:
139
+ """
140
+ Perform logical AND operation on two lists of intervals.
141
+
142
+ Args:
143
+ intervals_1 (list): First list of intervals.
144
+ intervals_2 (list): Second list of intervals.
145
+
146
+ Returns:
147
+ list: List of intervals representing the intersection of both lists.
148
+
149
+ Example:
150
+ >>> intervals1 = [RealInterval.closed(0.0, 2.0)]
151
+ >>> intervals2 = [RealInterval.closed(1.0, 3.0)]
152
+ >>> result = RealInterval.logical_and(intervals1, intervals2) # [1.0, 2.0]
153
+ """
154
+ @staticmethod
155
+ def logical_or(intervals_1: list[RealInterval], intervals_2: list[RealInterval]) -> list[RealInterval]:
156
+ """
157
+ Perform logical OR operation on two lists of intervals.
158
+
159
+ Args:
160
+ intervals_1 (list): First list of intervals.
161
+ intervals_2 (list): Second list of intervals.
162
+
163
+ Returns:
164
+ list: List of intervals representing the union of both lists.
165
+
166
+ Example:
167
+ >>> intervals1 = [RealInterval.closed(0.0, 1.0)]
168
+ >>> intervals2 = [RealInterval.closed(2.0, 3.0)]
169
+ >>> result = RealInterval.logical_or(intervals1, intervals2)
170
+ """
171
+ @staticmethod
172
+ def merge(intervals: list[RealInterval]) -> list[RealInterval]:
173
+ """
174
+ Merge overlapping intervals in a list.
175
+
176
+ Args:
177
+ intervals (list): List of intervals to merge.
178
+
179
+ Returns:
180
+ list: List of merged intervals with no overlaps.
181
+
182
+ Example:
183
+ >>> intervals = [RealInterval.closed(0.0, 2.0), RealInterval.closed(1.0, 3.0)]
184
+ >>> merged = RealInterval.merge(intervals) # [RealInterval.closed(0.0, 3.0)]
185
+ """
186
+ @staticmethod
187
+ def open(lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real) -> RealInterval:
188
+ """
189
+ Create an open interval (a, b).
190
+
191
+ Args:
192
+ lower_bound (float): The lower bound (exclusive).
193
+ upper_bound (float): The upper bound (exclusive).
194
+
195
+ Returns:
196
+ RealInterval: An open interval.
197
+
198
+ Example:
199
+ >>> interval = RealInterval.open(0.0, 1.0) # (0, 1)
200
+ >>> interval.contains(0.0) # False
201
+ >>> interval.contains(1.0) # False
202
+ >>> interval.contains(0.5) # True
203
+ """
204
+ @staticmethod
205
+ def sort(intervals: list[RealInterval], by_lower_bound: bool = True, ascending: bool = True) -> list[RealInterval]:
206
+ """
207
+ Sort a list of intervals.
208
+
209
+ Args:
210
+ intervals (list): List of intervals to sort.
211
+ by_lower_bound (bool, optional): Sort by lower bound if True, upper bound if False. Defaults to True.
212
+ ascending (bool, optional): Sort in ascending order if True, descending if False. Defaults to True.
213
+
214
+ Returns:
215
+ list: Sorted list of intervals.
216
+
217
+ Example:
218
+ >>> intervals = [RealInterval.closed(2.0, 3.0), RealInterval.closed(0.0, 1.0)]
219
+ >>> sorted_intervals = RealInterval.sort(intervals)
220
+ """
221
+ @staticmethod
222
+ def undefined() -> RealInterval:
223
+ """
224
+ Create an undefined interval.
225
+
226
+ Returns:
227
+ RealInterval: An undefined interval.
228
+
229
+ Example:
230
+ >>> undefined_interval = RealInterval.undefined()
231
+ >>> undefined_interval.is_defined() # False
232
+ """
233
+ def __eq__(self, arg0: RealInterval) -> bool:
234
+ ...
235
+ def __init__(self, lower_bound: ostk.core.type.Real, upper_bound: ostk.core.type.Real, type: typing.Any) -> None:
236
+ """
237
+ Create an interval with specified bounds and type.
238
+
239
+ Args:
240
+ lower_bound (float): The lower bound of the interval.
241
+ upper_bound (float): The upper bound of the interval.
242
+ type (RealInterval.Type): The type of interval (Closed, Open, HalfOpenLeft, HalfOpenRight).
243
+
244
+ Example:
245
+ >>> interval = RealInterval(0.0, 1.0, RealInterval.Type.Closed) # [0, 1]
246
+ >>> interval = RealInterval(0.0, 1.0, RealInterval.Type.Open) # (0, 1)
247
+ """
248
+ def __ne__(self, arg0: RealInterval) -> bool:
249
+ ...
250
+ def __repr__(self) -> str:
251
+ ...
252
+ def __str__(self) -> str:
253
+ ...
254
+ @typing.overload
255
+ def contains(self, real: ostk.core.type.Real) -> bool:
256
+ """
257
+ Check if the interval contains a real number.
258
+
259
+ Args:
260
+ real (float): The real number to check.
261
+
262
+ Returns:
263
+ bool: True if the interval contains the number, False otherwise.
264
+
265
+ Example:
266
+ >>> interval = RealInterval.closed(0.0, 1.0)
267
+ >>> interval.contains(0.5) # True
268
+ >>> interval.contains(1.5) # False
269
+ """
270
+ @typing.overload
271
+ def contains(self, interval: RealInterval) -> bool:
272
+ """
273
+ Check if this interval contains another interval.
274
+
275
+ Args:
276
+ interval (RealInterval): The interval to check containment for.
277
+
278
+ Returns:
279
+ bool: True if this interval contains the other interval, False otherwise.
280
+
281
+ Example:
282
+ >>> interval1 = RealInterval.closed(0.0, 2.0)
283
+ >>> interval2 = RealInterval.closed(0.5, 1.5)
284
+ >>> interval1.contains(interval2) # True
285
+ """
286
+ def get_intersection_with(self, interval: RealInterval) -> RealInterval:
287
+ """
288
+ Get the intersection of this interval with another interval.
289
+
290
+ Args:
291
+ interval (RealInterval): The interval to intersect with.
292
+
293
+ Returns:
294
+ RealInterval: The intersection interval, or undefined if no intersection.
295
+
296
+ Example:
297
+ >>> interval1 = RealInterval.closed(0.0, 2.0)
298
+ >>> interval2 = RealInterval.closed(1.0, 3.0)
299
+ >>> intersection = interval1.get_intersection_with(interval2)
300
+ >>> # intersection represents [1.0, 2.0]
301
+ """
302
+ def get_lower_bound(self) -> ostk.core.type.Real:
303
+ """
304
+ Get the lower bound of the interval.
305
+
306
+ Returns:
307
+ float: The lower bound value.
308
+
309
+ Example:
310
+ >>> interval = RealInterval.closed(0.0, 1.0)
311
+ >>> interval.get_lower_bound() # 0.0
312
+ """
313
+ def get_union_with(self, interval: RealInterval) -> RealInterval:
314
+ """
315
+ Get the union of this interval with another interval.
316
+
317
+ Args:
318
+ interval (RealInterval): The interval to union with.
319
+
320
+ Returns:
321
+ RealInterval: The union interval.
322
+
323
+ Example:
324
+ >>> interval1 = RealInterval.closed(0.0, 1.0)
325
+ >>> interval2 = RealInterval.closed(0.5, 2.0)
326
+ >>> union = interval1.get_union_with(interval2)
327
+ >>> # union represents [0.0, 2.0]
328
+ """
329
+ def get_upper_bound(self) -> ostk.core.type.Real:
330
+ """
331
+ Get the upper bound of the interval.
332
+
333
+ Returns:
334
+ float: The upper bound value.
335
+
336
+ Example:
337
+ >>> interval = RealInterval.closed(0.0, 1.0)
338
+ >>> interval.get_upper_bound() # 1.0
339
+ """
340
+ def intersects(self, interval: RealInterval) -> bool:
341
+ """
342
+ Check if this interval intersects with another interval.
343
+
344
+ Args:
345
+ interval (RealInterval): The interval to check intersection with.
346
+
347
+ Returns:
348
+ bool: True if intervals intersect, False otherwise.
349
+
350
+ Example:
351
+ >>> interval1 = RealInterval.closed(0.0, 2.0)
352
+ >>> interval2 = RealInterval.closed(1.0, 3.0)
353
+ >>> interval1.intersects(interval2) # True
354
+ """
355
+ def is_defined(self) -> bool:
356
+ """
357
+ Check if the interval is defined.
358
+
359
+ Returns:
360
+ bool: True if the interval is defined, False otherwise.
361
+
362
+ Example:
363
+ >>> interval = RealInterval.closed(0.0, 1.0)
364
+ >>> interval.is_defined() # True
365
+ """
366
+ def is_degenerate(self) -> bool:
367
+ """
368
+ Check if the interval is degenerate (single point).
369
+
370
+ Returns:
371
+ bool: True if the interval represents a single point, False otherwise.
372
+
373
+ Example:
374
+ >>> interval = RealInterval.closed(1.0, 1.0)
375
+ >>> interval.is_degenerate() # True
376
+ """
377
+ def to_string(self) -> ostk.core.type.String:
378
+ """
379
+ Convert the interval to a string representation.
380
+
381
+ Returns:
382
+ str: String representation of the interval.
383
+
384
+ Example:
385
+ >>> interval = RealInterval.closed(0.0, 1.0)
386
+ >>> interval.to_string() # "[0, 1]"
387
+ """