| Crates.io | euclidean |
| lib.rs | euclidean |
| version | 0.1.0 |
| created_at | 2025-04-21 21:37:24.880733+00 |
| updated_at | 2025-04-21 21:37:24.880733+00 |
| description | A collection of operations for euclidean geometry in three dimensions. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1643243 |
| size | 31,536 |
This crate contains a collection of type agnostic euclidean algorithms..
These include, but are not limited to:
The crate relies on linear_isomoprhic to abstract over the underlying
type, meaning that it can be used with a wide variety of underlying vector types.
Some functions are dimension agnostic. However, many assume $\mathbb{R}^3$.
Example use:
use crate::segment_segment_intersection;
use ::core::f32::consts::PI;
type Vec2 = nalgebra::Vector2<f32>;
type Vec3 = nalgebra::Vector3<f32>;
fn project_onto_polyline() {
let curve: Vec<_> = (0..50)
.map(|i| {
let t = i as f32 / 49.;
let t = t * PI;
Vec2::new(t.cos(), t.sin())
})
.collect();
let point = Vec2::new(0., 10.);
let (proj, param, interval) = project_onto_open_poly_line(&point, &curve);
assert!((proj - Vec2::new(0., 1.0)).norm() < 0.001,);
assert!((param - 0.5).abs() < 0.001);
assert!(interval == 24);
}
The library is tested directly against the Nalgebra crate. If you find that it doesn't work with your own vector type, please open an issue.