aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/spectrum.rs12
-rw-r--r--src/core/vector2.rs4
2 files changed, 14 insertions, 2 deletions
diff --git a/src/core/spectrum.rs b/src/core/spectrum.rs
index fb82a9e..41b3342 100644
--- a/src/core/spectrum.rs
+++ b/src/core/spectrum.rs
@@ -33,6 +33,18 @@ impl std::ops::Mul<Float> for &Spectrum {
}
}
+impl std::ops::Div<Float> for &Spectrum {
+ type Output = Spectrum;
+
+ fn div(self, op: Float) -> Self::Output {
+ Self::Output::new_rgb(
+ self.c[0] / op,
+ self.c[1] / op,
+ self.c[2] / op,
+ )
+ }
+}
+
impl std::ops::AddAssign<&Self> for Spectrum {
fn add_assign(&mut self, op: &Self) {
self.c[0] += op.c[0];
diff --git a/src/core/vector2.rs b/src/core/vector2.rs
index 3aadb46..858068e 100644
--- a/src/core/vector2.rs
+++ b/src/core/vector2.rs
@@ -60,8 +60,8 @@ impl Vector2f {
pub fn floor(&self) -> Self {
Self::new_xy(
- self.x.ceil(),
- self.y.ceil()
+ self.x.floor(),
+ self.y.floor()
)
}
}