Compare commits

...

2 Commits

Author SHA1 Message Date
1c4dc0edbe appropriate types 2024-09-28 20:19:03 -07:00
5e32fbe4ae absrel idea 2024-09-28 20:17:52 -07:00
4 changed files with 20 additions and 0 deletions

6
absrel/Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "absrel"
version = "0.1.0"
edition = "2021"
[dependencies]

4
absrel/src/abs.rs Normal file
View 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
View File

@ -0,0 +1,2 @@
pub mod abs;
pub mod rel;

8
absrel/src/rel.rs Normal file
View 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);