summaryrefslogtreecommitdiff
path: root/src/calculus.rs
diff options
context:
space:
mode:
authorRosyid Haryadi <rosyid_haryadi@protonmail.com>2025-03-01 16:43:50 +0700
committerRosyid Haryadi <rosyid_haryadi@protonmail.com>2025-03-01 16:43:50 +0700
commit084875ac8e9aa12cf6cc1892def9e4bc5fd4cdda (patch)
tree99fbc7b743fdf7a2b26ded0e8073c9a02be5240b /src/calculus.rs
parent2d7457db1c0c719de3e1f76161a35af3fb5ae0c9 (diff)
object list, something is still wrong
Diffstat (limited to 'src/calculus.rs')
-rw-r--r--src/calculus.rs6
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