pub trait Angle<S: BaseFloat>: Clone + Zero + PartialEq + PartialOrd + ApproxEq<Epsilon = S> + Neg<Output = Self> + Into<Rad<S>> + Into<Deg<S>> + ScalarConv<S> + Debug {
Show 24 methods
// Required methods
fn from<A: Angle<S>>(theta: A) -> Self;
fn full_turn() -> Self;
// Provided methods
fn neg_self(&mut self) { ... }
fn add_a(&self, other: Self) -> Self { ... }
fn sub_a(&self, other: Self) -> Self { ... }
fn div_a(&self, other: Self) -> S { ... }
fn rem_a(&self, other: Self) -> S { ... }
fn mul_s(&self, s: S) -> Self { ... }
fn div_s(&self, s: S) -> Self { ... }
fn rem_s(&self, s: S) -> Self { ... }
fn add_self_a(&mut self, other: Self) { ... }
fn sub_self_a(&mut self, other: Self) { ... }
fn mul_self_s(&mut self, s: S) { ... }
fn div_self_s(&mut self, s: S) { ... }
fn rem_self_s(&mut self, s: S) { ... }
fn normalize(&self) -> Self { ... }
fn normalize_self(&mut self) { ... }
fn opposite(&self) -> Self { ... }
fn bisect(&self, other: Self) -> Self { ... }
fn turn_div_2() -> Self { ... }
fn turn_div_3() -> Self { ... }
fn turn_div_4() -> Self { ... }
fn turn_div_6() -> Self { ... }
fn equiv(&self, other: &Self) -> bool { ... }
}
Expand description
Operations on angles.
Required Methods§
Provided Methods§
sourcefn sub_a(&self, other: Self) -> Self
fn sub_a(&self, other: Self) -> Self
Subtract another angle from this one, returning the new angle.
sourcefn rem_s(&self, s: S) -> Self
fn rem_s(&self, s: S) -> Self
Take the remainder of this angle by a scalar, returning the new angle.
sourcefn add_self_a(&mut self, other: Self)
fn add_self_a(&mut self, other: Self)
Add this angle with another, in-place.
sourcefn sub_self_a(&mut self, other: Self)
fn sub_self_a(&mut self, other: Self)
Subtract another angle from this one, in-place.
sourcefn mul_self_s(&mut self, s: S)
fn mul_self_s(&mut self, s: S)
Multiply this angle by a scalar, in-place.
sourcefn div_self_s(&mut self, s: S)
fn div_self_s(&mut self, s: S)
Divide this angle by a scalar, in-place.
sourcefn rem_self_s(&mut self, s: S)
fn rem_self_s(&mut self, s: S)
Take the remainder of this angle by a scalar, in-place.
sourcefn normalize_self(&mut self)
fn normalize_self(&mut self)
Normalize the angle to the range [0, full_turn)
.