Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c4dc0edbe | |||
5e32fbe4ae |
6
absrel/Cargo.toml
Normal file
6
absrel/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "absrel"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
4
absrel/src/abs.rs
Normal file
4
absrel/src/abs.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// This type represents an absolute value, such as a coordinate for a world position.
|
||||||
|
/// This is called a euclidean point in Geometric Algebra.
|
||||||
|
/// The most appropriate type here is a fixed-point value.
|
||||||
|
pub struct Absolute<T>(T);
|
2
absrel/src/lib.rs
Normal file
2
absrel/src/lib.rs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
pub mod abs;
|
||||||
|
pub mod rel;
|
8
absrel/src/rel.rs
Normal file
8
absrel/src/rel.rs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/// This type represents the difference between two absolute values.
|
||||||
|
/// This is called an ideal point in Geometric Algebra.
|
||||||
|
/// After you get your time delta or position delta,
|
||||||
|
/// implement your number-crunching logic using this type.
|
||||||
|
/// Once the calculation is complete, it can be added to an absolute value
|
||||||
|
/// with the effect of offsetting the value to a new absolute value.
|
||||||
|
/// The most appropriate type here is a floating point value.
|
||||||
|
pub struct Relative<T>(T);
|
Loading…
Reference in New Issue
Block a user