[−][src]Struct gramit::angle::Angle
An angle struct independent of representation as either degrees or radians.
Methods
impl Angle
[src]
pub fn zero() -> Angle
[src]
Construct an Angle
of zero.
pub fn full_circle() -> Angle
[src]
Construct an Angle
of 360 degrees (2*PI
radians).
pub fn half_circle() -> Angle
[src]
Construct an Angle
of 180 degrees (PI
radians).
pub fn from_radians(radians: f32) -> Angle
[src]
Construct an Angle
from a value given in radians.
pub fn from_degrees(degrees: f32) -> Angle
[src]
Constuct an Angle
from a value given in degrees.
pub fn radians(self) -> f32
[src]
Get the value of this Angle
in radians.
pub fn degrees(self) -> f32
[src]
Get the value of this Angle
in degrees.
pub fn sin(self) -> f32
[src]
Get the sine of this Angle
.
pub fn cos(self) -> f32
[src]
Get the cosine of this Angle
.
pub fn tan(self) -> f32
[src]
Get the tangent of this Angle
.
pub fn asin(x: f32) -> Option<Angle>
[src]
Compute the arc sine of the given value.
For values in the range [-1, 1], produces an Angle
in the range [-pi/2, pi/2] (radians).
For other values, produces None
.
pub fn acos(x: f32) -> Option<Angle>
[src]
Compute the arc cosine of the given value.
For values in the range [-1, 1], produces an Angle
in the range [0, pi] (radians). For
other values, produces None
.
pub fn atan(x: f32) -> Angle
[src]
Compute the arc tangent of the given value.
pub fn atan2(y: f32, x: f32) -> Angle
[src]
Compute the four-quadrant arc tangent of y
and x
.
pub fn sin_cos(self) -> (f32, f32)
[src]
Simultaneously compute the sine and cosine of this Angle
. Returns (sin(x), cos(x))
.
Trait Implementations
impl ApproxEq<Angle> for Angle
[src]
fn approx_eq(self, rhs: Angle) -> bool
[src]
fn within_threshold(self, rhs: Angle, threshold: Angle) -> bool
[src]
impl Clone for Angle
[src]
impl Copy for Angle
[src]
impl Default for Angle
[src]
impl PartialEq<Angle> for Angle
[src]
impl PartialOrd<Angle> for Angle
[src]
fn partial_cmp(&self, other: &Angle) -> Option<Ordering>
[src]
fn lt(&self, other: &Angle) -> bool
[src]
fn le(&self, other: &Angle) -> bool
[src]
fn gt(&self, other: &Angle) -> bool
[src]
fn ge(&self, other: &Angle) -> bool
[src]
impl Debug for Angle
[src]
impl Div<f32> for Angle
[src]
type Output = Angle
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Angle
[src]
impl Sub<Angle> for Angle
[src]
type Output = Angle
The resulting type after applying the -
operator.
fn sub(self, rhs: Angle) -> Angle
[src]
impl Add<Angle> for Angle
[src]
type Output = Angle
The resulting type after applying the +
operator.
fn add(self, rhs: Angle) -> Angle
[src]
impl Mul<f32> for Angle
[src]
type Output = Angle
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Angle
[src]
impl Mul<Angle> for f32
[src]
type Output = Angle
The resulting type after applying the *
operator.
fn mul(self, rhs: Angle) -> Angle
[src]
impl AddAssign<Angle> for Angle
[src]
fn add_assign(&mut self, rhs: Angle)
[src]
impl SubAssign<Angle> for Angle
[src]
fn sub_assign(&mut self, rhs: Angle)
[src]
impl MulAssign<f32> for Angle
[src]
fn mul_assign(&mut self, rhs: f32)
[src]
impl DivAssign<f32> for Angle
[src]
fn div_assign(&mut self, rhs: f32)
[src]
impl StructuralPartialEq for Angle
[src]
Auto Trait Implementations
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnwindSafe for Angle
impl RefUnwindSafe for Angle
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,