impl Degrees {
#[allow(dead_code)]
- fn to_radians(&self) -> Radians {
+ pub fn to_radians(&self) -> Radians {
Radians(self.0.to_radians())
}
}
impl Radians {
#[allow(dead_code)]
- fn to_degrees(&self) -> Degrees {
+ pub fn to_degrees(&self) -> Degrees {
Degrees(self.0.to_degrees())
}
+
+ /// Returns the reflection of the incident when mirrored along this angle.
+ pub fn mirror(&self, incidence: Radians) -> Radians {
+ Radians((std::f64::consts::PI + self.0 * 2.0 - incidence.0) % std::f64::consts::TAU)
+ }
}
////////// INTERSECTION ////////////////////////////////////////////////////////