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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//! 3D Projective Geometric Algebra types.
//!
//! This module provides specialized types for 3D PGA `Cl(3,0,1)`.
//!
//! # Types by Grade
//!
//! | Grade | Type | Components | Geometric Meaning |
//! |-------|------|------------|-------------------|
//! | 1 | [`Point`] | e₁, e₂, e₃, e₀ | Point (homogeneous) |
//! | 2 | [`Line`] | 6 components | Line (Plücker coords) |
//! | 3 | [`Plane`] | 4 components | Plane |
//! | 0+2+4 | [`Motor`] | 8 components | Rigid transformation (rotation + translation) |
//! | 1+3 | [`Flector`] | 8 components | Reflection (improper isometry) |
//!
//! # Points as Homogeneous Coordinates
//!
//! A PGA point is just a homogeneous coordinate:
//!
//! ```text
//! P = x·e₁ + y·e₂ + z·e₃ + w·e₀
//! ```
//!
//! | Type | Condition | Cartesian |
//! |------|-----------|-----------|
//! | Finite point | `w ≠ 0` | `(x/w, y/w, z/w)` |
//! | Point at infinity | `w = 0` | Direction `(x, y, z)` |
//!
//! Use `Point::from_cartesian(x, y, z)` for finite points (sets `w = 1`).
//!
//! # Lines and Plücker Coordinates
//!
//! If you've worked with 3D line representations, you may know **Plücker coordinates**:
//! a 6-component representation `(d, m)` where `d` is direction and `m` is moment.
//!
//! In PGA, a line is a grade-2 blade (bivector) with the same 6 components:
//!
//! | Plücker | PGA | Meaning |
//! |---------|-----|---------|
//! | `d` (direction) | `e₂₃, e₁₃, e₁₂` | "bulk" part (Euclidean bivector) |
//! | `m` (moment) | `e₀₁, e₀₂, e₀₃` | "weight" part (involves e₀) |
//!
//! **Plücker constraint**: Valid lines satisfy `d · m = 0`. In PGA this is automatic
//! when lines are constructed geometrically (via join of points or meet of planes).
//!
//! # Join and Meet: Spanning and Intersecting
//!
//! The two fundamental operations in PGA are **join** (∨) and **meet** (∧):
//!
//! | Operation | Symbol | Result | Meaning |
//! |-----------|--------|--------|---------|
//! | **Join** | `a ∨ b` | Higher grade | Span (smallest object containing both) |
//! | **Meet** | `a ∧ b` | Lower grade | Intersection |
//!
//! ## Join Examples (building up)
//!
//! | Inputs | Result |
//! |--------|--------|
//! | Point ∨ Point | Line through both |
//! | Point ∨ Line | Plane containing both |
//! | Line ∨ Point | Plane containing both |
//!
//! ## Meet Examples (cutting down)
//!
//! | Inputs | Result |
//! |--------|--------|
//! | Plane ∧ Plane | Line of intersection |
//! | Plane ∧ Line | Point of intersection |
//! | Line ∧ Plane | Point of intersection |
//!
//! **Note**: In degenerate cases (parallel lines, point on plane, etc.),
//! the result is an "ideal" (infinite) element.
//!
//! # Motors: Better Than 4×4 Matrices
//!
//! A **motor** represents a rigid body transform (rotation + translation):
//!
//! | 4×4 Matrix | Motor |
//! |------------|-------|
//! | 16 floats | 8 floats |
//! | Orthogonality drift | Cheap normalization |
//! | Complex interpolation | Natural SLERP |
//! | `M₂ × M₁` | `M₂ * M₁` (same!) |
//!
//! Motors transform objects via the **sandwich product**: `X' = M X M̃`
//!
//! ## Motor from Components
//!
//! - `Motor::from_rotation_x(angle)`, `_y`, `_z` — pure rotation
//! - `Motor::from_translation(dx, dy, dz)` — pure translation
//! - `Motor::from_axis_angle(&axis, angle)` — rotation around arbitrary axis
//!
//! # Flectors: Reflections
//!
//! A **flector** is an improper isometry (includes a reflection). While motors
//! have `det = +1`, flectors have `det = -1`. Use for mirror transformations.
//!
//! # nalgebra Integration
//!
//! With `nalgebra-0_33` (or `0_32`/`0_34`), conversions are provided:
//!
//! | clifford | nalgebra |
//! |----------|----------|
//! | `Point` | `Point3<T>` |
//! | `Motor` | `Isometry3<T>` |
//! | `Line` | (no direct equivalent) |
//! | `Plane` | (no direct equivalent) |
//!
//! # Example
//!
//! ```
//! use clifford::specialized::projective::dim3::{Point, Line, Motor};
//! use clifford::ops::Join;
//! use std::f64::consts::FRAC_PI_2;
//! use approx::abs_diff_eq;
//!
//! // Create points
//! let p1 = Point::from_cartesian(0.0, 0.0, 0.0);
//! let p2 = Point::from_cartesian(1.0, 0.0, 0.0);
//!
//! // Join two points to get a line
//! let line = p1.join(&p2);
//!
//! // Create a rotation motor
//! let rotor = Motor::from_rotation_z(FRAC_PI_2);
//!
//! // Create a translation motor
//! let translation = Motor::from_translation(1.0, 2.0, 3.0);
//! ```
// Generated code (do not edit manually)
// Domain-specific extensions
// Re-export generated types and wrapper aliases
pub use *;
pub use NalgebraConversionError;