absrel idea

This commit is contained in:
Quaternions 2024-09-28 20:16:43 -07:00
parent 438d0ec6ec
commit 5e32fbe4ae
4 changed files with 18 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]

3
absrel/src/abs.rs Normal file
View File

@ -0,0 +1,3 @@
/// This type represents an absolute value, such as a coordinate for a world position.
/// This is called a euclidean point in Geometric Algebra.
pub struct Absolute<T>(T);

2
absrel/src/lib.rs Normal file
View File

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

7
absrel/src/rel.rs Normal file
View File

@ -0,0 +1,7 @@
/// 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.
pub struct Relative<T>(T);