pfc-geometry 0.2.8__tar.gz → 0.2.9__tar.gz
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.
- {pfc_geometry-0.2.8/pfc_geometry.egg-info → pfc_geometry-0.2.9}/PKG-INFO +1 -1
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/base.py +1 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/point.py +1 -1
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/quaternion.py +4 -2
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/time.py +13 -10
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9/pfc_geometry.egg-info}/PKG-INFO +1 -1
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/.github/workflows/publish_pypi.yml +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/.gitignore +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/.vscode/settings.json +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/LICENSE +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/README.md +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/__init__.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/coordinate_frame.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/gps.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/mass.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/testing.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/geometry/transformation.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/SOURCES.txt +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/dependency_links.txt +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/requires.txt +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/top_level.txt +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/pyproject.toml +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/requirements-dev.txt +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/requirements.txt +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/setup.cfg +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/__init__.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/quat_body_diff_test.csv +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_base.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_coord.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_gps.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_mass.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_point.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_quaternion.py +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_remove_outliers.csv +0 -0
- {pfc_geometry-0.2.8 → pfc_geometry-0.2.9}/tests/test_transform.py +0 -0
|
@@ -172,7 +172,7 @@ def is_perpendicular(a: Point, b: Point, tolerance=1e-6):
|
|
|
172
172
|
@ppmeth
|
|
173
173
|
def min_angle_between(p1: Point, p2: Point):
|
|
174
174
|
angle = angle_between(p1, p2) % np.pi
|
|
175
|
-
return
|
|
175
|
+
return np.minimum(angle, np.pi - angle)
|
|
176
176
|
|
|
177
177
|
def arbitrary_perpendicular(v: Point) -> Point:
|
|
178
178
|
return Point(-v.y, v.x, 0).unit()
|
|
@@ -11,7 +11,7 @@ this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11
11
|
"""
|
|
12
12
|
from __future__ import annotations
|
|
13
13
|
from .point import Point
|
|
14
|
-
from .base import Base
|
|
14
|
+
from .base import Base, dprep
|
|
15
15
|
from geometry import PZ
|
|
16
16
|
import numpy as np
|
|
17
17
|
import numpy.typing as npt
|
|
@@ -253,7 +253,9 @@ class Quaternion(Base):
|
|
|
253
253
|
# does the rotation reverse the Z axis?
|
|
254
254
|
return np.sign(self.transform_point(PZ()).z) > 0
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
257
259
|
|
|
258
260
|
def Q0(count=1):
|
|
259
261
|
return Quaternion.zero(count)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from geometry import Base
|
|
2
3
|
from numbers import Number
|
|
3
4
|
from typing import Self
|
|
@@ -6,27 +7,30 @@ from time import time
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class Time(Base):
|
|
9
|
-
cols=["t", "dt"]
|
|
10
|
-
|
|
10
|
+
cols = ["t", "dt"]
|
|
11
|
+
|
|
11
12
|
@staticmethod
|
|
12
|
-
def from_t(t: np.ndarray) ->
|
|
13
|
+
def from_t(t: np.ndarray) -> Time:
|
|
13
14
|
if isinstance(t, Number):
|
|
14
|
-
return Time(t, 1/
|
|
15
|
+
return Time(t, 1 / 25)
|
|
15
16
|
else:
|
|
16
17
|
if len(t) == 1:
|
|
17
|
-
dt = np.array([1/
|
|
18
|
+
dt = np.array([1 / 25])
|
|
18
19
|
else:
|
|
19
20
|
arr = np.diff(t)
|
|
20
21
|
dt = np.concatenate([arr, [arr[-1]]])
|
|
21
22
|
return Time(t, dt)
|
|
22
23
|
|
|
24
|
+
@staticmethod
|
|
25
|
+
def uniform(duration: float, npoints: int | None) -> Time:
|
|
26
|
+
return Time.from_t(
|
|
27
|
+
np.linspace(0, duration, npoints if npoints else int(np.ceil(duration * 25)))
|
|
28
|
+
)
|
|
29
|
+
|
|
23
30
|
def scale(self, duration) -> Self:
|
|
24
31
|
old_duration = self.t[-1] - self.t[0]
|
|
25
32
|
sfac = duration / old_duration
|
|
26
|
-
return Time(
|
|
27
|
-
self.t[0] + (self.t - self.t[0]) * sfac,
|
|
28
|
-
self.dt * sfac
|
|
29
|
-
)
|
|
33
|
+
return Time(self.t[0] + (self.t - self.t[0]) * sfac, self.dt * sfac)
|
|
30
34
|
|
|
31
35
|
def reset_zero(self):
|
|
32
36
|
return Time(self.t - self.t[0], self.dt)
|
|
@@ -37,4 +41,3 @@ class Time(Base):
|
|
|
37
41
|
|
|
38
42
|
def extend(self):
|
|
39
43
|
return Time.concatenate([self, Time(self.t[-1] + self.dt[-1], self.dt[-1])])
|
|
40
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|