diff options
Diffstat (limited to 'src/calculus.rs')
-rw-r--r-- | src/calculus.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/calculus.rs b/src/calculus.rs index ac33514..67138d1 100644 --- a/src/calculus.rs +++ b/src/calculus.rs @@ -1,4 +1,5 @@ pub mod calculus { + #[derive(Copy, Clone)] pub struct Vec3 { pub x: f32, pub y: f32, @@ -78,4 +79,9 @@ pub mod calculus { self.origin.add(&self.direction.scalar_mul(t)) } } + + pub fn deg2rad(deg: f32) -> f32 { + deg * std::f32::consts::PI / 180.0 + } + }
\ No newline at end of file |