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,28 @@
1
+ Metadata-Version: 2.2
2
+ Name: open-space-toolkit-mathematics
3
+ Version: 4.6.0
4
+ Summary: Geometry, curve fitting, optimization.
5
+ Author: Open Space Collective
6
+ Author-email: contact@open-space-collective.org
7
+ License: Apache License 2.0
8
+ Keywords: open-space-collective,open-space-toolkit mathematics
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: numpy<3.0,>=1.0
15
+ Requires-Dist: open-space-toolkit-core~=5.0
16
+
17
+ # Open Space Toolkit ▸ Mathematics
18
+
19
+ Geometry, curve fitting, optimization.
20
+
21
+ [![Build and Test](https://github.com/open-space-collective/open-space-toolkit-mathematics/actions/workflows/build-test.yml/badge.svg?branch=main)](https://github.com/open-space-collective/open-space-toolkit-mathematics/actions/workflows/build-test.yml)
22
+ [![Code Coverage](https://codecov.io/gh/open-space-collective/open-space-toolkit-mathematics/branch/main/graph/badge.svg)](https://codecov.io/gh/open-space-collective/open-space-toolkit-mathematics)
23
+ [![Documentation](https://img.shields.io/readthedocs/pip/stable.svg)](https://open-space-collective.github.io/open-space-toolkit-mathematics)
24
+ [![GitHub version](https://badge.fury.io/gh/open-space-collective%2Fopen-space-toolkit-mathematics.svg)](https://badge.fury.io/gh/open-space-collective%2Fopen-space-toolkit-mathematics)
25
+ [![PyPI version](https://badge.fury.io/py/open-space-toolkit-mathematics.svg)](https://badge.fury.io/py/open-space-toolkit-mathematics)
26
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
27
+
28
+ [GitHub](https://github.com/open-space-collective/open-space-toolkit-mathematics)
@@ -0,0 +1,68 @@
1
+ ostk/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
2
+ ostk/mathematics/OpenSpaceToolkitMathematicsPy.cpython-39-aarch64-linux-gnu.so,sha256=l2tTwcc4z4QqOgJEtT8vZ3wJi92uaStgzAIG7VfZ1Ec,2070232
3
+ ostk/mathematics/__init__.py,sha256=U81I6jh2hIPyuT4dtZjNcLi-CQ8yXIvtFn32tVK1YCY,92
4
+ ostk/mathematics/__init__.pyi,sha256=J_InNBNyrZgyfVQ-r8PVZq37Wb9kM0acE4BZW2Jwo14,484
5
+ ostk/mathematics/libopen-space-toolkit-mathematics.so.4,sha256=E2_XxUqmg3wD7laoCPA7WAaIiFWOg7RcIKzHocXlsN4,2442368
6
+ ostk/mathematics/object.pyi,sha256=LvzjdseOx-IFv9viLEk-HXZ0GvEiERm6IbACHsVlsIk,16911
7
+ ostk/mathematics/solver.pyi,sha256=65dIAcfMVhWL-32ZeZI_Mb5VRqpDcjLkvrQElQZ04Ws,16067
8
+ ostk/mathematics/curve_fitting/__init__.pyi,sha256=IwJimnlynre4O-6tuIOC_t0kYEWTHQGMN4K9e6nGOO0,6436
9
+ ostk/mathematics/curve_fitting/interpolator.pyi,sha256=Pi50YICu9h8mCl9xRB2-OcsdI6NpGF-BnnqkePeHF6g,10800
10
+ ostk/mathematics/geometry/__init__.pyi,sha256=MDlOaEflUrXapczgfBoVCNJfDmKshUqle_reFyqG8mU,19131
11
+ ostk/mathematics/geometry/d2/__init__.pyi,sha256=N9AEvpz3sLOOYdCK3UrvpcbVnVzY9tRbiM1HBSsc3K4,32839
12
+ ostk/mathematics/geometry/d2/object.pyi,sha256=2RCR6SY12bc0daKS7lfX6wspQYR-z6m7AOEwpH0QrdY,77633
13
+ ostk/mathematics/geometry/d3/__init__.pyi,sha256=ivpeJQdCqEonp6nzEe6ttRz1Bd1iUD3OvceiUXpVIyk,39850
14
+ ostk/mathematics/geometry/d3/object.pyi,sha256=5xN55Dy_nLlUwOI1vxl7-iVnRWtY5SErEF6fU8BXcZA,160470
15
+ ostk/mathematics/geometry/d3/transformation/__init__.pyi,sha256=wjoTgfldZsg2a26-4iRZd_FyMFFWRYa2FfQmm55-4b0,81
16
+ ostk/mathematics/geometry/d3/transformation/rotation.pyi,sha256=P2P5ecrRyusAQWCh6fVGvuIKAsAuUDS0Yx51HO-5lgQ,57269
17
+ ostk/mathematics/test/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
18
+ ostk/mathematics/test/test_object.py,sha256=WtksTu9zz8_UNkQYKLO64nNBFDBkRWM_DXFuAWTdKUM,1027
19
+ ostk/mathematics/test/curve_fitting/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
20
+ ostk/mathematics/test/curve_fitting/interpolator/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
21
+ ostk/mathematics/test/curve_fitting/interpolator/test_barycentric_rational.py,sha256=Gk4QGPozj21b5zdYtCliChxBazqxaL2tG12TDjOaR8o,1436
22
+ ostk/mathematics/test/curve_fitting/interpolator/test_cubic_spline.py,sha256=Pnd7Y6n-7_MOcSw3Vi5WxgsVDrmzzE41S5QOcyhUxso,1689
23
+ ostk/mathematics/test/curve_fitting/interpolator/test_interpolator.py,sha256=46px5NKN8TJO9L9KbopsK9pixq0j3_Xu7PchDQTSEPQ,2093
24
+ ostk/mathematics/test/curve_fitting/interpolator/test_linear.py,sha256=JNGUrBtaN6mCTeVO_bVEU5-BHmgtxLts3Lgj2890lcw,1417
25
+ ostk/mathematics/test/geometry/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
26
+ ostk/mathematics/test/geometry/test_angle.py,sha256=HOzlWUApgN6LN0g0Zts0cFQ6In_nmbYpFb3CnWWHVR0,10136
27
+ ostk/mathematics/test/geometry/d2/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
28
+ ostk/mathematics/test/geometry/d2/conftest.py,sha256=YmbYbVERGClW1ICbGDiMG3d0XYgtH8JNQbOVjlgXh8o,1762
29
+ ostk/mathematics/test/geometry/d2/test_object.py,sha256=JwyeSL4JIR8LY2is0SJKdoTeKiJINDv4b8uFd6dY75c,546
30
+ ostk/mathematics/test/geometry/d2/test_transformation.py,sha256=WEG_qVZFx-0wZB6Qn3uHKBGdEJ04fq5Vds2Kqx_YkO0,2095
31
+ ostk/mathematics/test/geometry/d2/object/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
32
+ ostk/mathematics/test/geometry/d2/object/test_composite.py,sha256=t_ap8UXmvRK7vgyHIXh36Oym_UJa6bHmJFFBr3O6kfM,2751
33
+ ostk/mathematics/test/geometry/d2/object/test_line.py,sha256=Dr0uHk-gFLJcsC69W1DBCvvipLlAbTVPBxigJGKXORQ,1433
34
+ ostk/mathematics/test/geometry/d2/object/test_linestring.py,sha256=EucjDiSSQ2Ab3-huWtfanE6Cb0Jazb78LUuiFnpe8Mo,5933
35
+ ostk/mathematics/test/geometry/d2/object/test_multipolygon.py,sha256=qjgX71axIqKPUGCazdYgv0rbJTJfq-LcEDjnDEhfaok,3469
36
+ ostk/mathematics/test/geometry/d2/object/test_point.py,sha256=Eoq1FAYB6W4yrjpassgG9PRb3Zdg2DOjpmTZZuNiQ9M,6457
37
+ ostk/mathematics/test/geometry/d2/object/test_point_set.py,sha256=sM8P1SWoNL8lNw1kZdSQbD_5WkGGRwiRtgpmnolHvzk,3319
38
+ ostk/mathematics/test/geometry/d2/object/test_polygon.py,sha256=fHEJDXmzgl24-eQ3gMGIBwNZsEa-3F6_8T6eLzaVgFI,12621
39
+ ostk/mathematics/test/geometry/d2/object/test_segment.py,sha256=M1QTkseGo1ADeslcEl5JzlQEc_1-1LpBV4av_FuPX7E,3072
40
+ ostk/mathematics/test/geometry/d3/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
41
+ ostk/mathematics/test/geometry/d3/test_intersection.py,sha256=7QrduhVXyTHG0lGLEHNgv4olvFrR6TR0MNgu9acmRd4,61
42
+ ostk/mathematics/test/geometry/d3/test_object.py,sha256=7QrduhVXyTHG0lGLEHNgv4olvFrR6TR0MNgu9acmRd4,61
43
+ ostk/mathematics/test/geometry/d3/test_transformation.py,sha256=7QrduhVXyTHG0lGLEHNgv4olvFrR6TR0MNgu9acmRd4,61
44
+ ostk/mathematics/test/geometry/d3/object/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
45
+ ostk/mathematics/test/geometry/d3/object/test_composite.py,sha256=03wi6k35a2lwyM29q5STjqX4CHL1IofYm2hBzERQlzU,7710
46
+ ostk/mathematics/test/geometry/d3/object/test_cuboid.py,sha256=xJp6ImRnkNw_k6Tt8RaSXlsGnSqM-SlQSBfbm7SwJuA,470
47
+ ostk/mathematics/test/geometry/d3/object/test_line.py,sha256=d-CvDjXeH1WQcleCU2yt4FdHLhWgy45NGzn3mEwy6xE,1690
48
+ ostk/mathematics/test/geometry/d3/object/test_linestring.py,sha256=L2gEJGDOaP17RgbLbX0-kBjskW_MrPLxVyf_l9yyxag,5938
49
+ ostk/mathematics/test/geometry/d3/object/test_point.py,sha256=-5Cjy3Pru3UWbMO7vBDNiJYfUkqVVxxZtDgsMYYaosc,6611
50
+ ostk/mathematics/test/geometry/d3/object/test_point_set.py,sha256=nE20GLaghjPqAB9EuCd66wsYX4KC2Gs_CSWcsmqaCQM,3587
51
+ ostk/mathematics/test/geometry/d3/object/test_polygon.py,sha256=7ZjucWMsNzppN3pptxHgGgOtOGv1grseT7VnctgOJP4,4262
52
+ ostk/mathematics/test/geometry/d3/object/test_segment.py,sha256=HWg-BCJoa74EgWlvUPd85v_qR2p9THi0ejhtG0EQNEA,4027
53
+ ostk/mathematics/test/geometry/d3/objects/test_cuboid.py,sha256=uIDwPbkygXFIopKc2kayKYgadNfOKD_zxf3w2J4DfTY,471
54
+ ostk/mathematics/test/geometry/d3/transformation/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
55
+ ostk/mathematics/test/geometry/d3/transformation/rotation/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
56
+ ostk/mathematics/test/geometry/d3/transformation/rotation/test_euler_angle.py,sha256=eTIxAqUfCQj6eZfoQgNu-1xFg0O4sbKk4n8XHQwXD2E,4393
57
+ ostk/mathematics/test/geometry/d3/transformation/rotation/test_quaternion.py,sha256=hYsEWbZIp4eSpZ9EWtWOl3iau58AH2btloIkXP9zUuw,7050
58
+ ostk/mathematics/test/geometry/d3/transformation/rotation/test_rotation_matrix.py,sha256=zG3lQlelSIBTCPOPbYmh6CAmbuLtM1E5hJwVR4hOu2M,1479
59
+ ostk/mathematics/test/geometry/d3/transformation/rotation/test_rotation_vector.py,sha256=ngzrvqH_0QRGwNsWc2RupUkpsTU5vZI-eoh5q2BkKRQ,1568
60
+ ostk/mathematics/test/object/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
61
+ ostk/mathematics/test/object/test_interval.py,sha256=rf7tL-m76inO18rzxopkWrk-cSjKhoN5xXek6e53wAU,21708
62
+ ostk/mathematics/test/object/test_vector.py,sha256=5MG3s8vhgoGKAIc5GzswlZObyIrJDIPNtsEd5wNORPU,76
63
+ ostk/mathematics/test/solver/test_numerical_solver.py,sha256=NS9XS6Z2dBzeKnUBiIflObGzd5DM1KVAoH1SBd3DXDc,5700
64
+ open_space_toolkit_mathematics-4.6.0.dist-info/METADATA,sha256=JZjUY_m8rtrUwbPjJkabvh8jscu5kdpg9NfhirRIgzI,1804
65
+ open_space_toolkit_mathematics-4.6.0.dist-info/WHEEL,sha256=HKTDQRaBjeful1LuAej8fX2VXGhDWeCDzK_M-yn2ypk,110
66
+ open_space_toolkit_mathematics-4.6.0.dist-info/top_level.txt,sha256=zOR18699uDYnafgarhL8WU_LmTZY_5NVqutv-flp_x4,5
67
+ open_space_toolkit_mathematics-4.6.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
68
+ open_space_toolkit_mathematics-4.6.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.8.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py39-none-manylinux2014_aarch64
5
+
ostk/__init__.py ADDED
@@ -0,0 +1 @@
1
+ # Apache License 2.0
@@ -0,0 +1,5 @@
1
+ # Apache License 2.0
2
+
3
+ from ostk.core import *
4
+
5
+ from .OpenSpaceToolkitMathematicsPy import *
@@ -0,0 +1,11 @@
1
+ from __future__ import annotations
2
+ from ostk import core as OpenSpaceToolkitCorePy
3
+ from ostk.core import container
4
+ from ostk.core import filesystem
5
+ from ostk.core import type
6
+ from ostk import mathematics as OpenSpaceToolkitMathematicsPy
7
+ from . import curve_fitting
8
+ from . import geometry
9
+ from . import object
10
+ from . import solver
11
+ __all__ = ['OpenSpaceToolkitCorePy', 'OpenSpaceToolkitMathematicsPy', 'container', 'curve_fitting', 'filesystem', 'geometry', 'object', 'solver', 'type']
@@ -0,0 +1,155 @@
1
+ from __future__ import annotations
2
+ import numpy
3
+ import typing
4
+ from . import interpolator
5
+ __all__ = ['Interpolator', 'interpolator']
6
+ class Interpolator:
7
+ class Type:
8
+ """
9
+ Members:
10
+
11
+ BarycentricRational
12
+
13
+ CubicSpline
14
+
15
+ Linear
16
+ """
17
+ BarycentricRational: typing.ClassVar[Interpolator.Type] # value = <Type.BarycentricRational: 0>
18
+ CubicSpline: typing.ClassVar[Interpolator.Type] # value = <Type.CubicSpline: 1>
19
+ Linear: typing.ClassVar[Interpolator.Type] # value = <Type.Linear: 2>
20
+ __members__: typing.ClassVar[dict[str, Interpolator.Type]] # value = {'BarycentricRational': <Type.BarycentricRational: 0>, 'CubicSpline': <Type.CubicSpline: 1>, 'Linear': <Type.Linear: 2>}
21
+ def __eq__(self, other: typing.Any) -> bool:
22
+ ...
23
+ def __getstate__(self) -> int:
24
+ ...
25
+ def __hash__(self) -> int:
26
+ ...
27
+ def __index__(self) -> int:
28
+ ...
29
+ def __init__(self, value: int) -> None:
30
+ ...
31
+ def __int__(self) -> int:
32
+ ...
33
+ def __ne__(self, other: typing.Any) -> bool:
34
+ ...
35
+ def __repr__(self) -> str:
36
+ ...
37
+ def __setstate__(self, state: int) -> None:
38
+ ...
39
+ def __str__(self) -> str:
40
+ ...
41
+ @property
42
+ def name(self) -> str:
43
+ ...
44
+ @property
45
+ def value(self) -> int:
46
+ ...
47
+ @staticmethod
48
+ def generate_interpolator(interpolation_type: Interpolator.Type, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) -> Interpolator:
49
+ """
50
+ Generate an interpolator of specified type with data points.
51
+
52
+ Args:
53
+ interpolation_type (Interpolator.Type): The type of interpolation.
54
+ x (np.array): The x-coordinates of data points.
55
+ y (np.array): The y-coordinates of data points.
56
+
57
+ Returns:
58
+ Interpolator: The created interpolator.
59
+
60
+ Example:
61
+ >>> x = np.array([0.0, 1.0, 2.0])
62
+ >>> y = np.array([0.0, 2.0, 4.0])
63
+ >>> interpolator = Interpolator.generate_interpolator(
64
+ ... Interpolator.Type.CubicSpline, x, y
65
+ ... )
66
+ """
67
+ def __init__(self, interpolation_type: Interpolator.Type) -> None:
68
+ """
69
+ Create an interpolator of specified type.
70
+
71
+ Args:
72
+ interpolation_type (Interpolator.Type): The type of interpolation method.
73
+
74
+ Example:
75
+ >>> interpolator = Interpolator(Interpolator.Type.Linear)
76
+ """
77
+ @typing.overload
78
+ def compute_derivative(self, x: float) -> float:
79
+ """
80
+ Compute the derivative of the interpolation at a single point.
81
+
82
+ Args:
83
+ x (float): The x-coordinate to compute derivative at.
84
+
85
+ Returns:
86
+ float: The derivative value.
87
+
88
+ Example:
89
+ >>> interpolator = Interpolator.generate_interpolator(
90
+ ... Interpolator.Type.Linear, [0.0, 1.0], [0.0, 2.0]
91
+ ... )
92
+ >>> derivative = interpolator.compute_derivative(0.5) # 2.0
93
+ """
94
+ @typing.overload
95
+ def compute_derivative(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
96
+ """
97
+ Compute the derivative of the interpolation at multiple points.
98
+
99
+ Args:
100
+ x (np.array): The x-coordinates to compute derivatives at.
101
+
102
+ Returns:
103
+ (np.array): The derivative values.
104
+
105
+ Example:
106
+ >>> interpolator = Interpolator.generate_interpolator(
107
+ ... Interpolator.Type.Linear, [0.0, 1.0], [0.0, 2.0]
108
+ ... )
109
+ >>> derivatives = interpolator.compute_derivative([0.2, 0.8])
110
+ """
111
+ @typing.overload
112
+ def evaluate(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
113
+ """
114
+ Evaluate the interpolation at multiple points.
115
+
116
+ Args:
117
+ x (np.array): The x-coordinates to evaluate at.
118
+
119
+ Returns:
120
+ (np.array): The interpolated y-values.
121
+
122
+ Example:
123
+ >>> interpolator = Interpolator.generate_interpolator(
124
+ ... Interpolator.Type.Linear, [0.0, 1.0], [0.0, 2.0]
125
+ ... )
126
+ >>> result = interpolator.evaluate([0.5, 1.5])
127
+ """
128
+ @typing.overload
129
+ def evaluate(self, x: float) -> float:
130
+ """
131
+ Evaluate the interpolation at a single point.
132
+
133
+ Args:
134
+ x (float): The x-coordinate to evaluate at.
135
+
136
+ Returns:
137
+ float: The interpolated y-value.
138
+
139
+ Example:
140
+ >>> interpolator = Interpolator.generate_interpolator(
141
+ ... Interpolator.Type.Linear, [0.0, 1.0], [0.0, 2.0]
142
+ ... )
143
+ >>> result = interpolator.evaluate(0.5) # 1.0
144
+ """
145
+ def get_interpolation_type(self) -> Interpolator.Type:
146
+ """
147
+ Get the interpolation type of this interpolator.
148
+
149
+ Returns:
150
+ Interpolator.Type: The interpolation type.
151
+
152
+ Example:
153
+ >>> interpolator = Interpolator(Interpolator.Type.CubicSpline)
154
+ >>> type = interpolator.get_interpolation_type()
155
+ """
@@ -0,0 +1,243 @@
1
+ from __future__ import annotations
2
+ import numpy
3
+ import ostk.core.type
4
+ import ostk.mathematics.curve_fitting
5
+ import typing
6
+ __all__ = ['BarycentricRational', 'CubicSpline', 'Linear']
7
+ class BarycentricRational(ostk.mathematics.curve_fitting.Interpolator):
8
+ def __init__(self, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) -> None:
9
+ """
10
+ Create a barycentric rational interpolator with data points.
11
+
12
+ Args:
13
+ x (np.array): The x-coordinates of data points.
14
+ y (np.array): The y-coordinates of data points.
15
+
16
+ Example:
17
+ >>> x = np.array([0.0, 1.0, 2.0, 3.0])
18
+ >>> y = np.array([1.0, 2.0, 0.5, 3.0])
19
+ >>> interpolator = BarycentricRational(x, y)
20
+ """
21
+ @typing.overload
22
+ def compute_derivative(self, x: float) -> float:
23
+ """
24
+ Compute the derivative of the barycentric rational interpolation at a single point.
25
+
26
+ Args:
27
+ x (float): The x-coordinate to compute derivative at.
28
+
29
+ Returns:
30
+ float: The derivative value.
31
+
32
+ Example:
33
+ >>> interpolator = BarycentricRational([0.0, 1.0, 2.0], [1.0, 2.0, 0.5])
34
+ >>> derivative = interpolator.compute_derivative(0.5)
35
+ """
36
+ @typing.overload
37
+ def compute_derivative(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
38
+ """
39
+ Compute the derivative of the barycentric rational interpolation at multiple points.
40
+
41
+ Args:
42
+ x (np.array): The x-coordinates to compute derivatives at.
43
+
44
+ Returns:
45
+ (np.array): The derivative values.
46
+
47
+ Example:
48
+ >>> interpolator = BarycentricRational([0.0, 1.0, 2.0], [1.0, 2.0, 0.5])
49
+ >>> derivatives = interpolator.compute_derivative([0.2, 0.8])
50
+ """
51
+ @typing.overload
52
+ def evaluate(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
53
+ """
54
+ Evaluate the barycentric rational interpolation at multiple points.
55
+
56
+ Args:
57
+ x (np.array): The x-coordinates to evaluate at.
58
+
59
+ Returns:
60
+ (np.array): The interpolated y-values.
61
+
62
+ Example:
63
+ >>> interpolator = BarycentricRational([0.0, 1.0, 2.0], [1.0, 2.0, 0.5])
64
+ >>> result = interpolator.evaluate([0.5, 1.5])
65
+ """
66
+ @typing.overload
67
+ def evaluate(self, x: float) -> float:
68
+ """
69
+ Evaluate the barycentric rational interpolation at a single point.
70
+
71
+ Args:
72
+ x (float): The x-coordinate to evaluate at.
73
+
74
+ Returns:
75
+ float: The interpolated y-value.
76
+
77
+ Example:
78
+ >>> interpolator = BarycentricRational([0.0, 1.0, 2.0], [1.0, 2.0, 0.5])
79
+ >>> result = interpolator.evaluate(0.5)
80
+ """
81
+ class CubicSpline(ostk.mathematics.curve_fitting.Interpolator):
82
+ @typing.overload
83
+ def __init__(self, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) -> None:
84
+ """
85
+ Create a cubic spline interpolator with data points.
86
+
87
+ Args:
88
+ x (np.array): The x-coordinates of data points.
89
+ y (np.array): The y-coordinates of data points.
90
+
91
+ Example:
92
+ >>> x = np.array([0.0, 1.0, 2.0, 3.0])
93
+ >>> y = np.array([0.0, 1.0, 4.0, 9.0])
94
+ >>> interpolator = CubicSpline(x, y)
95
+ """
96
+ @typing.overload
97
+ def __init__(self, y: numpy.ndarray[numpy.float64[m, 1]], x_0: ostk.core.type.Real, h: ostk.core.type.Real) -> None:
98
+ """
99
+ Create a cubic spline interpolator with uniform spacing.
100
+
101
+ Args:
102
+ y (np.array): The y-coordinates of data points.
103
+ x_0 (float): The starting x-coordinate.
104
+ h (float): The uniform spacing between x-coordinates.
105
+
106
+ Example:
107
+ >>> y = np.array([0.0, 1.0, 4.0, 9.0])
108
+ >>> interpolator = CubicSpline(y, 0.0, 1.0) # x = [0, 1, 2, 3]
109
+ """
110
+ @typing.overload
111
+ def compute_derivative(self, x: float) -> float:
112
+ """
113
+ Compute the derivative of the cubic spline at a single point.
114
+
115
+ Args:
116
+ x (float): The x-coordinate to compute derivative at.
117
+
118
+ Returns:
119
+ float: The derivative value.
120
+
121
+ Example:
122
+ >>> interpolator = CubicSpline([0.0, 1.0, 2.0], [0.0, 1.0, 4.0])
123
+ >>> derivative = interpolator.compute_derivative(0.5)
124
+ """
125
+ @typing.overload
126
+ def compute_derivative(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
127
+ """
128
+ Compute the derivative of the cubic spline at multiple points.
129
+
130
+ Args:
131
+ x (np.array): The x-coordinates to compute derivatives at.
132
+
133
+ Returns:
134
+ (np.array): The derivative values.
135
+
136
+ Example:
137
+ >>> interpolator = CubicSpline([0.0, 1.0, 2.0], [0.0, 1.0, 4.0])
138
+ >>> derivatives = interpolator.compute_derivative([0.2, 0.8])
139
+ """
140
+ @typing.overload
141
+ def evaluate(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
142
+ """
143
+ Evaluate the cubic spline interpolation at multiple points.
144
+
145
+ Args:
146
+ x (np.array): The x-coordinates to evaluate at.
147
+
148
+ Returns:
149
+ (np.array): The interpolated y-values.
150
+
151
+ Example:
152
+ >>> interpolator = CubicSpline([0.0, 1.0, 2.0], [0.0, 1.0, 4.0])
153
+ >>> result = interpolator.evaluate([0.5, 1.5])
154
+ """
155
+ @typing.overload
156
+ def evaluate(self, x: float) -> float:
157
+ """
158
+ Evaluate the cubic spline interpolation at a single point.
159
+
160
+ Args:
161
+ x (float): The x-coordinate to evaluate at.
162
+
163
+ Returns:
164
+ float: The interpolated y-value.
165
+
166
+ Example:
167
+ >>> interpolator = CubicSpline([0.0, 1.0, 2.0], [0.0, 1.0, 4.0])
168
+ >>> result = interpolator.evaluate(0.5)
169
+ """
170
+ class Linear(ostk.mathematics.curve_fitting.Interpolator):
171
+ def __init__(self, x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]]) -> None:
172
+ """
173
+ Create a linear interpolator with data points.
174
+
175
+ Args:
176
+ x (np.array): The x-coordinates of data points.
177
+ y (np.array): The y-coordinates of data points.
178
+
179
+ Example:
180
+ >>> x = np.array([0.0, 1.0, 2.0])
181
+ >>> y = np.array([0.0, 2.0, 4.0])
182
+ >>> interpolator = Linear(x, y)
183
+ """
184
+ @typing.overload
185
+ def compute_derivative(self, x: float) -> float:
186
+ """
187
+ Compute the derivative of the linear interpolation at a single point.
188
+
189
+ Args:
190
+ x (float): The x-coordinate to compute derivative at.
191
+
192
+ Returns:
193
+ float: The derivative value.
194
+
195
+ Example:
196
+ >>> interpolator = Linear([0.0, 1.0], [0.0, 2.0])
197
+ >>> derivative = interpolator.compute_derivative(0.5) # 2.0
198
+ """
199
+ @typing.overload
200
+ def compute_derivative(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
201
+ """
202
+ Compute the derivative of the linear interpolation at multiple points.
203
+
204
+ Args:
205
+ x (np.array): The x-coordinates to compute derivatives at.
206
+
207
+ Returns:
208
+ (np.array): The derivative values.
209
+
210
+ Example:
211
+ >>> interpolator = Linear([0.0, 1.0], [0.0, 2.0])
212
+ >>> derivatives = interpolator.compute_derivative([0.2, 0.8])
213
+ """
214
+ @typing.overload
215
+ def evaluate(self, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]:
216
+ """
217
+ Evaluate the linear interpolation at multiple points.
218
+
219
+ Args:
220
+ x (np.array): The x-coordinates to evaluate at.
221
+
222
+ Returns:
223
+ (np.array): The interpolated y-values.
224
+
225
+ Example:
226
+ >>> interpolator = Linear([0.0, 1.0], [0.0, 2.0])
227
+ >>> result = interpolator.evaluate([0.5, 1.5])
228
+ """
229
+ @typing.overload
230
+ def evaluate(self, x: float) -> float:
231
+ """
232
+ Evaluate the linear interpolation at a single point.
233
+
234
+ Args:
235
+ x (float): The x-coordinate to evaluate at.
236
+
237
+ Returns:
238
+ float: The interpolated y-value.
239
+
240
+ Example:
241
+ >>> interpolator = Linear([0.0, 1.0], [0.0, 2.0])
242
+ >>> result = interpolator.evaluate(0.5) # 1.0
243
+ """