Metadata-Version: 2.5
Name: nd_line
Version: 0.2.1
Summary: Interpolate points on an n-dimensional line by euclidean arc length
Project-URL: Homepage, https://github.com/thedannymarsh/nd_line
Project-URL: Bug Tracker, https://github.com/thedannymarsh/nd_line/issues
Project-URL: Changelog, https://github.com/thedannymarsh/nd_line/blob/main/CHANGELOG.md
Author-email: Daniel Marshall <dpm42@duke.edu>
License: MIT License
        
        Copyright (c) 2022 Daniel Marshall
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: numpy
Requires-Dist: scipy
Provides-Extra: dev
Requires-Dist: commitizen<5,>=4; extra == 'dev'
Requires-Dist: pre-commit<5,>=4.0; extra == 'dev'
Requires-Dist: pytest<10,>=8; extra == 'dev'
Description-Content-Type: text/markdown

# 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 line
- `ln.length`: the length of the line
- `ln.type`: linear if not spline approximated, spline otherwise

#### Example

```python
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
