# [−][src]Struct cgmath::Rad

    #[repr(C)]
    pub struct Rad<S>(pub S);

An angle, in radians.

This type is marked as `#[repr(C)]`.

## Trait Implementations

### `impl<S: BaseFloat> Angle for Rad<S>`[src]

#### `type Unitless = S`

#### `fn full_turn() -> Rad<S>`[src]

A full rotation.

#### `fn sin(self) -> S`[src]

Compute the sine of the angle, returning a unitless ratio. Read more

#### `fn cos(self) -> S`[src]

Compute the cosine of the angle, returning a unitless ratio. Read more

#### `fn tan(self) -> S`[src]

Compute the tangent of the angle, returning a unitless ratio. Read more

#### `fn sin_cos(self) -> (S, S)`[src]

Compute the sine and cosine of the angle, returning the result as a pair. Read more

#### `fn asin(a: S) -> Rad<S>`[src]

Compute the arcsine of the ratio, returning the resulting angle. Read more

#### `fn acos(a: S) -> Rad<S>`[src]

Compute the arccosine of the ratio, returning the resulting angle. Read more

#### `fn atan(a: S) -> Rad<S>`[src]

Compute the arctangent of the ratio, returning the resulting angle. Read more

#### `fn atan2(a: S, b: S) -> Rad<S>`[src]

#### `fn normalize(self) -> Self`[src]

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

#### `fn normalize_signed(self) -> Self`[src]

Return the angle, normalized to the range `[-turn_div_2, turn_div_2)`.

#### `fn opposite(self) -> Self`[src]

Return the angle rotated by half a turn.

#### `fn bisect(self, other: Self) -> Self`[src]

Returns the interior bisector of the two angles.

#### `fn turn_div_2() -> Self`[src]

Half of a full rotation.

#### `fn turn_div_3() -> Self`[src]

A third of a full rotation.

#### `fn turn_div_4() -> Self`[src]

A quarter of a full rotation.

#### `fn turn_div_6() -> Self`[src]

A sixth of a full rotation.

#### `fn csc(self) -> Self::Unitless`[src]

Compute the cosecant of the angle. Read more

#### `fn cot(self) -> Self::Unitless`[src]

Compute the cotangent of the angle. Read more

#### `fn sec(self) -> Self::Unitless`[src]

Compute the secant of the angle. Read more

### `impl<S: Clone> Clone for Rad<S>`[src]

#### `fn clone(&self) -> Rad<S>`[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`1.0.0[src]

Performs copy-assignment from `source`. Read more

### `impl<S: PartialOrd> PartialOrd<Rad<S>> for Rad<S>`[src]

#### `fn partial_cmp(&self, other: &Rad<S>) -> Option<Ordering>`[src]

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rad<S>) -> bool`[src]

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rad<S>) -> bool`[src]

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rad<S>) -> bool`[src]

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rad<S>) -> bool`[src]

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl<S: PartialEq> PartialEq<Rad<S>> for Rad<S>`[src]

#### `fn eq(&self, other: &Rad<S>) -> bool`[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rad<S>) -> bool`[src]

This method tests for `!=`.

### `impl<S> From<Rad<S>> for Deg<S> where
S: BaseFloat,` [src]

#### `fn from(rad: Rad<S>) -> Deg<S>`[src]

Performs the conversion.

### `impl<S> From<Deg<S>> for Rad<S> where
S: BaseFloat,` [src]

#### `fn from(deg: Deg<S>) -> Rad<S>`[src]

Performs the conversion.

### `impl<S: Copy> Copy for Rad<S>`[src]

### `impl<S: BaseFloat> Add<Rad<S>> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `+` operator.

#### `fn add(self, other: Rad<S>) -> Rad<S>`[src]

Performs the `+` operation.

### `impl<'a, S: BaseFloat> Add<&'a Rad<S>> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `+` operator.

#### `fn add(self, other: &'a Rad<S>) -> Rad<S>`[src]

Performs the `+` operation.

### `impl<'a, S: BaseFloat> Add<Rad<S>> for &'a Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `+` operator.

#### `fn add(self, other: Rad<S>) -> Rad<S>`[src]

Performs the `+` operation.

### `impl<'a, 'b, S: BaseFloat> Add<&'a Rad<S>> for &'b Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `+` operator.

#### `fn add(self, other: &'a Rad<S>) -> Rad<S>`[src]

Performs the `+` operation.

### `impl<S: BaseFloat> Sub<Rad<S>> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `-` operator.

#### `fn sub(self, other: Rad<S>) -> Rad<S>`[src]

Performs the `-` operation.

### `impl<'a, S: BaseFloat> Sub<&'a Rad<S>> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `-` operator.

#### `fn sub(self, other: &'a Rad<S>) -> Rad<S>`[src]

Performs the `-` operation.

### `impl<'a, S: BaseFloat> Sub<Rad<S>> for &'a Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `-` operator.

#### `fn sub(self, other: Rad<S>) -> Rad<S>`[src]

Performs the `-` operation.

### `impl<'a, 'b, S: BaseFloat> Sub<&'a Rad<S>> for &'b Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `-` operator.

#### `fn sub(self, other: &'a Rad<S>) -> Rad<S>`[src]

Performs the `-` operation.

### `impl<S: BaseFloat> Mul<S> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `*` operator.

#### `fn mul(self, other: S) -> Rad<S>`[src]

Performs the `*` operation.

### `impl<'a, S: BaseFloat> Mul<S> for &'a Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `*` operator.

#### `fn mul(self, other: S) -> Rad<S>`[src]

Performs the `*` operation.

### `impl<S: BaseFloat> Div<Rad<S>> for Rad<S>`[src]

#### `type Output = S`

The resulting type after applying the `/` operator.

#### `fn div(self, other: Rad<S>) -> S`[src]

Performs the `/` operation.

### `impl<'a, S: BaseFloat> Div<&'a Rad<S>> for Rad<S>`[src]

#### `type Output = S`

The resulting type after applying the `/` operator.

#### `fn div(self, other: &'a Rad<S>) -> S`[src]

Performs the `/` operation.

### `impl<'a, S: BaseFloat> Div<Rad<S>> for &'a Rad<S>`[src]

#### `type Output = S`

The resulting type after applying the `/` operator.

#### `fn div(self, other: Rad<S>) -> S`[src]

Performs the `/` operation.

### `impl<'a, 'b, S: BaseFloat> Div<&'a Rad<S>> for &'b Rad<S>`[src]

#### `type Output = S`

The resulting type after applying the `/` operator.

#### `fn div(self, other: &'a Rad<S>) -> S`[src]

Performs the `/` operation.

### `impl<S: BaseFloat> Div<S> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `/` operator.

#### `fn div(self, other: S) -> Rad<S>`[src]

Performs the `/` operation.

### `impl<'a, S: BaseFloat> Div<S> for &'a Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `/` operator.

#### `fn div(self, other: S) -> Rad<S>`[src]

Performs the `/` operation.

### `impl<S: BaseFloat> Rem<Rad<S>> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `%` operator.

#### `fn rem(self, other: Rad<S>) -> Rad<S>`[src]

Performs the `%` operation.

### `impl<'a, S: BaseFloat> Rem<&'a Rad<S>> for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `%` operator.

#### `fn rem(self, other: &'a Rad<S>) -> Rad<S>`[src]

Performs the `%` operation.

### `impl<'a, S: BaseFloat> Rem<Rad<S>> for &'a Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `%` operator.

#### `fn rem(self, other: Rad<S>) -> Rad<S>`[src]

Performs the `%` operation.

### `impl<'a, 'b, S: BaseFloat> Rem<&'a Rad<S>> for &'b Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `%` operator.

#### `fn rem(self, other: &'a Rad<S>) -> Rad<S>`[src]

Performs the `%` operation.

### `impl<S: BaseFloat> Neg for Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `-` operator.

#### `fn neg(self) -> Rad<S>`[src]

Performs the unary `-` operation.

### `impl<'a, S: BaseFloat> Neg for &'a Rad<S>`[src]

#### `type Output = Rad<S>`

The resulting type after applying the `-` operator.

#### `fn neg(self) -> Rad<S>`[src]

Performs the unary `-` operation.

### `impl<S: BaseFloat + AddAssign<S>> AddAssign<Rad<S>> for Rad<S>`[src]

#### `fn add_assign(&mut self, other: Rad<S>)`[src]

Performs the `+=` operation.

### `impl<S: BaseFloat + SubAssign<S>> SubAssign<Rad<S>> for Rad<S>`[src]

#### `fn sub_assign(&mut self, other: Rad<S>)`[src]

Performs the `-=` operation.

### `impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Rad<S>`[src]

#### `fn mul_assign(&mut self, scalar: S)`[src]

Performs the `*=` operation.

### `impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Rad<S>`[src]

#### `fn div_assign(&mut self, scalar: S)`[src]

Performs the `/=` operation.

### `impl<S: BaseFloat + RemAssign<S>> RemAssign<Rad<S>> for Rad<S>`[src]

#### `fn rem_assign(&mut self, other: Rad<S>)`[src]

Performs the `%=` operation.

### `impl<S: Debug> Debug for Rad<S>`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl<S: BaseFloat> Sum<Rad<S>> for Rad<S>`[src]

#### `fn sum<I: Iterator<Item = Rad<S>>>(iter: I) -> Rad<S>`[src]

Method which takes an iterator and generates `Self` from the elements by "summing up" the items. Read more

### `impl<'a, S: 'a + BaseFloat> Sum<&'a Rad<S>> for Rad<S>`[src]

#### `fn sum<I: Iterator<Item = &'a Rad<S>>>(iter: I) -> Rad<S>`[src]

Method which takes an iterator and generates `Self` from the elements by "summing up" the items. Read more

### `impl<S: BaseFloat> AbsDiffEq<Rad<S>> for Rad<S>`[src]

#### `type Epsilon = S::Epsilon`

Used for specifying relative comparisons.

#### `fn default_epsilon() -> S::Epsilon`[src]

The default tolerance to use when testing values that are close together. Read more

#### `fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool`[src]

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

#### `fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool`[src]

The inverse of `ApproxEq::abs_diff_eq`.

### `impl<S: BaseFloat> RelativeEq<Rad<S>> for Rad<S>`[src]

#### `fn default_max_relative() -> S::Epsilon`[src]

The default relative tolerance for testing values that are far-apart. Read more

#### `fn relative_eq(
&self,
other: &Self,
epsilon: S::Epsilon,
max_relative: S::Epsilon
) -> bool`[src]

A test for equality that uses a relative comparison if the values are far apart.

#### `fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool`[src]

The inverse of `ApproxEq::relative_eq`.

### `impl<S: BaseFloat> UlpsEq<Rad<S>> for Rad<S>`[src]

#### `fn default_max_ulps() -> u32`[src]

The default ULPs to tolerate when testing values that are far-apart. Read more

#### `fn ulps_eq(&self, other: &Self, epsilon: S::Epsilon, max_ulps: u32) -> bool`[src]

A test for equality that uses units in the last place (ULP) if the values are far apart.

#### `fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool`[src]

The inverse of `ApproxEq::ulps_eq`.

### `impl<S: Bounded> Bounded for Rad<S>`[src]

#### `fn min_value() -> Rad<S>`[src]

returns the smallest finite number this type can represent

#### `fn max_value() -> Rad<S>`[src]

returns the largest finite number this type can represent

### `impl<S: BaseFloat> Zero for Rad<S>`[src]

#### `fn zero() -> Rad<S>`[src]

Returns the additive identity element of `Self`, `0`. # Purity Read more

#### `fn is_zero(&self) -> bool`[src]

Returns `true` if `self` is equal to the additive identity.

#### `fn set_zero(&mut self)`[src]

Sets `self` to the additive identity element of `Self`, `0`.

### `impl<S> Distribution<Rad<S>> for Standard where
Standard: Distribution<S>,
S: BaseFloat + SampleUniform,` [src]

#### `fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Rad<S>`[src]

Generate a random value of `T`, using `rng` as the source of randomness.

#### `fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,` [src]

Create an iterator that generates random values of `T`, using `rng` as the source of randomness. Read more

## Auto Trait Implementations

### `impl<S> Send for Rad<S> where
S: Send,`

### `impl<S> Unpin for Rad<S> where
S: Unpin,`

### `impl<S> Sync for Rad<S> where
S: Sync,`

### `impl<S> UnwindSafe for Rad<S> where
S: UnwindSafe,`

### `impl<S> RefUnwindSafe for Rad<S> where
S: RefUnwindSafe,`

## Blanket Implementations

### `impl<T> ToOwned for T where
T: Clone,` [src]

#### `type Owned = T`

The resulting type after obtaining ownership.

#### `fn to_owned(&self) -> T`[src]

Creates owned data from borrowed data, usually by cloning. Read more

#### `fn clone_into(&self, target: &mut T)`[src]

🔬 This is a nightly-only experimental API. (`toowned_clone_into`)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `fn into(self) -> U`[src]

Performs the conversion.

### `impl<T> From<T> for T`[src]

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

#### `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]

Performs the conversion.

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

### `impl<T, Rhs> NumAssignOps<Rhs> for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,` [src]

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)