1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Mathematical utilities and type definitions.
//!
//! This module provides fundamental types used throughout the library
//! and utility functions for coordinate transformations.
use ;
// Re-export coordinate utilities for convenience
pub use ;
/// Scalar type used throughout the library (currently `f64`).
pub type Real = f64;
/// 2D vector with [`Real`] components.
pub type Vec2 = ;
/// 3D vector with [`Real`] components.
pub type Vec3 = ;
/// 2D point with [`Real`] coordinates.
pub type Pt2 = ;
/// 3D point with [`Real`] coordinates.
pub type Pt3 = ;
/// 3×3 matrix with [`Real`] entries.
pub type Mat3 = ;
/// 4×4 matrix with [`Real`] entries.
pub type Mat4 = ;
/// 3D rigid transform (SE(3)) using [`Real`].
pub type Iso3 = ;
/// Convert a 2D point in Euclidean coordinates into homogeneous coordinates.
///
/// Given a point `p = (x, y)`, returns the homogeneous vector `(x, y, 1)`.
/// Convert a 3D homogeneous vector back to a 2D point.
///
/// The input is interpreted as `(x, y, w)` and the result is `(x / w, y / w)`.
/// The caller is responsible for ensuring that `w != 0`.