nd_line
Interpolate points on an n-dimensional line by euclidean arc length.
Installation
pip install nd_line
Methods
-
ln.interp(dist): returns a point dist length along the arc of the line -
ln.interp_rat(ratio): ratio should be a value between 0 and 1, returns a value ratio*length along the line -
ln.splineify(samples): generates a new line from a spline approximation, occurs in place, use samples to specify how many points will be sampled from the splines to generate the new line
Attributes
ln.points: the points of the lineln.length: the length of the lineln.type: linear if not spline approximated, spline otherwise
Example
from nd_line.nd_line import nd_line
import numpy as np
ln = nd_line(np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2]]))
interpolated_point = ln.interp(1.5)
line_length = ln.length
halfway_point = ln.interp_rat(0.5)
Notes
Currently points must be sampled one at a time, future version will allow interpolation of a list of distances along the line
Metadata
Release files for nd-line 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nd_line-0.2.1.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nd_line-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / nd_line-0.2.1.tar.gz
| Download URL | nd_line-0.2.1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8c3309a3dc76b6e8e963625797ee29d9cc30569273948aec34851c36ed0e571
|
|
BLAKE2b-256 checksum How to use checksums |
89d4a91c50e07d05aee6bf7cbe130b31c05afbc364d9870f0989e74c8250d189
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / nd_line-0.2.1-py3-none-any.whl
| Download URL | nd_line-0.2.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f34b356516ef5bb0320ebce4672856f045e61376b149e19140a0ab8140648263
|
|
BLAKE2b-256 checksum How to use checksums |
9e8e547bb2a3ef0ddef4c69019f3e44cf75d58c7e4438ce3198d36306df8c266
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|