Trait cgmath::Angle

source ·
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§

source

fn from<A: Angle<S>>(theta: A) -> Self

Create a new angle from any other valid angle.

source

fn full_turn() -> Self

Provided Methods§

source

fn neg_self(&mut self)

Negate this angle, in-place.

source

fn add_a(&self, other: Self) -> Self

Add this angle with another, returning the new angle.

source

fn sub_a(&self, other: Self) -> Self

Subtract another angle from this one, returning the new angle.

source

fn div_a(&self, other: Self) -> S

Divide this angle by another, returning the ratio.

source

fn rem_a(&self, other: Self) -> S

Take the remainder of this angle with another.

source

fn mul_s(&self, s: S) -> Self

Multiply this angle by a scalar, returning the new angle.

source

fn div_s(&self, s: S) -> Self

Divide this angle by a scalar, returing the new angle.

source

fn rem_s(&self, s: S) -> Self

Take the remainder of this angle by a scalar, returning the new angle.

source

fn add_self_a(&mut self, other: Self)

Add this angle with another, in-place.

source

fn sub_self_a(&mut self, other: Self)

Subtract another angle from this one, in-place.

source

fn mul_self_s(&mut self, s: S)

Multiply this angle by a scalar, in-place.

source

fn div_self_s(&mut self, s: S)

Divide this angle by a scalar, in-place.

source

fn rem_self_s(&mut self, s: S)

Take the remainder of this angle by a scalar, in-place.

source

fn normalize(&self) -> Self

Return the angle, normalized to the range [0, full_turn).

source

fn normalize_self(&mut self)

Normalize the angle to the range [0, full_turn).

source

fn opposite(&self) -> Self

Return the angle rotated by half a turn

source

fn bisect(&self, other: Self) -> Self

Returns the interior bisector of the two angles

source

fn turn_div_2() -> Self

source

fn turn_div_3() -> Self

source

fn turn_div_4() -> Self

source

fn turn_div_6() -> Self

source

fn equiv(&self, other: &Self) -> bool

Implementors§

source§

impl<S: BaseFloat> Angle<S> for Deg<S>

source§

impl<S: BaseFloat> Angle<S> for Rad<S>