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
//! Specialized types for common geometric algebras.
//!
//! This module provides optimized, ergonomic types organized by algebra type
//! and dimension. Currently supported:
//!
//! - **[`conformal`]**: Conformal geometric algebra (CGA) for 3D
//! - **[`euclidean`]**: Euclidean geometric algebra (EGA) for 2D and 3D
//! - **[`elliptic`]**: Elliptic projective geometry for 2D
//! - **[`projective`]**: Projective geometric algebra (PGA) for 2D and 3D
//! - **[`complex`]**: Complex numbers Cl(0,1,0)
//! - **[`dual`]**: Dual numbers Cl(0,0,1) for automatic differentiation
//! - **[`dualquat`]**: Dual quaternions Cl(0,2,1) for rigid transformations
//! - **[`hyperbolic`]**: Hyperbolic algebras: numbers Cl(1,0,0) and plane Cl(2,1,0)
//! - **[`minkowski`]**: Minkowski spacetime algebras (indefinite signature)
//! - **[`quaternion`]**: Quaternions Cl(0,2,0)
//!
//! # Type Organization
//!
//! ```text
//! specialized/
//! conformal/
//! dim3/ - 3D Conformal GA: RoundPoint, Dipole, Circle, Sphere, Motor
//! euclidean/
//! dim2/ - 2D Euclidean GA: Vector, Bivector, Rotor
//! dim3/ - 3D Euclidean GA: Vector, Bivector, Trivector, Rotor
//! elliptic/
//! dim2/ - 2D Elliptic: Point, Line, Rotor
//! projective/
//! dim2/ - 2D PGA: Point, Line, Motor
//! dim3/ - 3D PGA: Point, Line, Plane, Motor
//! complex/ - Complex numbers: Scalar, ImagUnit, Complex
//! dual/ - Dual numbers: Scalar, DualUnit, Dual
//! dualquat/ - Dual quaternions: Scalar, Vector, Bivector, DualQuaternion
//! hyperbolic/ - Hyperbolic numbers: Scalar, HypUnit, Hyperbolic
//! dim2/ - 2D Hyperbolic plane: Point, Line, Rotor
//! minkowski/
//! dim2/ - 2D Minkowski: Vector, Bivector, Eventor, Spacetime
//! dim3/ - 3D Minkowski: Vector, Bivector, Trivector, Eventor
//! quaternion/ - Quaternions: Scalar, Imaginary, Bivector, Quaternion
//! ```
//!
//! # Benefits of Specialized Types
//!
//! - **Named fields**: Access components as `x`, `y`, `z` instead of indices
//! - **Type safety**: Vectors, bivectors, and rotors are distinct types
//! - **Ergonomics**: Common operations with intuitive method names
//!
//! # Choosing Generic vs Specialized
//!
//! Use **specialized types** when:
//! - Working exclusively in 2D or 3D Euclidean space
//! - You want named field access (`v.x`, `v.y`, `v.z`)
//! - Type safety between grades is important
//!
//! Use **generic [`Multivector`](crate::algebra::Multivector)** when:
//! - Working with arbitrary signatures (PGA, CGA, etc.)
//! - You need to mix grades freely
//! - Writing dimension-generic algorithms
//!
//! # Example
//!
//! ```ignore
//! use clifford::ops::Transform;
//! use clifford::specialized::euclidean::dim3::{Vector, Bivector, Rotor};
//!
//! // Create a vector
//! let v = Vector::new(1.0, 0.0, 0.0);
//!
//! // Create a 90° rotation in the xy-plane
//! let rotor = Rotor::from_angle_plane(
//! std::f64::consts::FRAC_PI_2,
//! Bivector::unit_xy(),
//! );
//!
//! // Apply rotation
//! let rotated = rotor.transform(&v);
//! assert!((rotated.x()).abs() < 1e-10);
//! assert!((rotated.y() - 1.0).abs() < 1e-10);
//! ```