Interpolate points on an n-dimensional line by euclidean arc length
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nd_line-0.2.0.tar.gz.
File metadata
- Download URL: nd_line-0.2.0.tar.gz
- Upload date:
- Size: 272.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6bbed0f5a8aa16bfdf4ef1c6ce3440fcbfb8b60dcd508de559dbe28a5e64d8c
|
|
| MD5 |
19c61f91fb8b0e4e1fdff8e03d2cb732
|
|
| BLAKE2b-256 |
5b984ad2d13d02088d60427d3adf3b353ed32547a0643afa45f0191399be505b
|
File details
Details for the file nd_line-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nd_line-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf75ae3f639db66d1fc9e9db420250e8011d7ec5be6f855cd151f3aeedd8a19e
|
|
| MD5 |
f9b222bb933eded19a80e8c9f028470a
|
|
| BLAKE2b-256 |
ec0052187e0284c783c0c897eb07b0cc169de54caed1aab739357a60c59952e8
|