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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
//! # Lie group and Lie algebra in rust
//!
//! liealg is a library for computing Lie algebra and Lie group in 3D space(SO3 and SE3).
//! It is mainly used in robot kinematics and other related area.
//! If you want to do some general Lie group and Lie algebra calculations,
//! it is better not to use this library.
//!
//! ## Traits
//! liealg provides a set of mathematical entity traits for Lie group and Lie algebra.
//! these are [Adjoint], [Algebra], [Group], [Vector].
//! liealg provides a standard implementation of these traits, but users can also implement their own types.
//!
//! liealg also provides a trait [Real] for using more types of real numbers, except f32, f64, it can support most real number types, such as rational and decimal, users can also define their own real number types.
//!
//! ## Implementations
//!
//! liealg provides two implementations of Lie group and Lie algebra, SO3 and SE3, which correspond to rotation and rigid body motion in 3D space.
//!
//! |group|algebra|vector|
//! |-|-|-|
//! |SO3|so3|Vec3|
//! |SE3|se3|Vec6|
//!
//! ## Usage
//! add liealg to your dependencies
//! ```toml
//! [dependencies]
//! liealg = "0.1"
//! ```
//!
//! import prelude module
//! ```rust
//! use liealg::prelude::*;
//! ```
//! Rotation
//! ```ignore
//! Vec3 ---> so3 ---> SO3 -------> AdjSO3
//! hat exp adjoint
//!
//! Vec3 <--- so3 <--- SO3
//! vee log
//! ```
//!
//! Rigid body motion
//! ```ignore
//! Vec6 ---> se3 ---> SE3 -------> AdjSE3
//! hat exp adjoint
//!
//! Vec6 <--- se3 <--- SE3
//! vee log
//! ```
//!
//! ## Example
//! ### Rotation
//! ```rust
//! use std::f32::consts::FRAC_PI_2;
//! use liealg::prelude::*;
//! use liealg::Vec3;
//! let vec = Vec3::new(0., 0., FRAC_PI_2);
//! println!("vec: {}", vec);
//! let so3 = vec.hat();
//! println!("so3: {}", so3);
//! let rot = so3.exp();
//! println!("rot: {:.2}", rot);
//! let so3_ = rot.log();
//! let vec_ = so3_.vee();
//! println!("vec_: {}", vec_);
//! ```
//!
//! ### Rigid body motion
//!
//! ```rust
//! use std::f32::consts::FRAC_PI_2;
//! use liealg::prelude::*;
//! use liealg::Vec6;
//! let vec = Vec6::new([0., 0., 1.], [0., -1., 0.]) * FRAC_PI_2;
//! println!("vec: {}", vec);
//! let se3 = vec.hat();
//! println!("se3: {}", se3);
//! let rigid = se3.exp();
//! println!("rigid: {:.2}", rigid);
//! let se3_ = rigid.log();
//! let vec_ = se3_.vee();
//! println!("vec_: {}", vec_);
//! ```
//!
use Debug;
use ;
pub use Point;
pub use ;
pub use ;
pub use *;
/// prelude module
/// # real number trait
/// support ops: +, -, *, /, %, +=, -=, *=, /=, %=
///
/// consts: 0, 1, π, 1/π, ln2, ......
///
/// compare ops: >, <, <=, >=
/// lie algebra vector representation
/// lie algebra trait
/// lie algebra trait
/// Group trait