Trait cgmath::Angle
[−]
[src]
pub trait Angle<S: BaseFloat>: Clone + Zero + PartialEq + PartialOrd + ApproxEq<S> + Neg<Output=Self> + Into<Rad<S>> + Into<Deg<S>> + ScalarConv<S> + Debug { fn from<A: Angle<S>>(theta: A) -> Self; fn full_turn() -> Self; 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 { ... } }
Operations on angles.
Required Methods
fn from<A: Angle<S>>(theta: A) -> Self
Create a new angle from any other valid angle.
fn full_turn() -> Self
Provided Methods
fn neg_self(&mut self)
Negate this angle, in-place.
fn add_a(&self, other: Self) -> Self
Add this angle with another, returning the new angle.
fn sub_a(&self, other: Self) -> Self
Subtract another angle from this one, returning the new angle.
fn div_a(&self, other: Self) -> S
Divide this angle by another, returning the ratio.
fn rem_a(&self, other: Self) -> S
Take the remainder of this angle with another.
fn mul_s(&self, s: S) -> Self
Multiply this angle by a scalar, returning the new angle.
fn div_s(&self, s: S) -> Self
Divide this angle by a scalar, returing the new angle.
fn rem_s(&self, s: S) -> Self
Take the remainder of this angle by a scalar, returning the new angle.
fn add_self_a(&mut self, other: Self)
Add this angle with another, in-place.
fn sub_self_a(&mut self, other: Self)
Subtract another angle from this one, in-place.
fn mul_self_s(&mut self, s: S)
Multiply this angle by a scalar, in-place.
fn div_self_s(&mut self, s: S)
Divide this angle by a scalar, in-place.
fn rem_self_s(&mut self, s: S)
Take the remainder of this angle by a scalar, in-place.
fn normalize(&self) -> Self
Return the angle, normalized to the range [0, full_turn)
.
fn normalize_self(&mut self)
Normalize the angle to the range [0, full_turn)
.
fn opposite(&self) -> Self
Return the angle rotated by half a turn
fn bisect(&self, other: Self) -> Self
Returns the interior bisector of the two angles