# Struct siege_math::angle::Angle
[−]
[src]

#[repr(C)]pub struct Angle<F>(_);

A type for representing an angle, without needing to remember if it is denominated in Radians, Degrees, or otherwise.

## Methods

`impl<F: FullFloat> Angle<F>`

[src]

`pub fn new_radians(radians: F) -> Angle<F>`

[src]

Create an angle from radians

`pub fn from_radians(radians: F) -> Angle<F>`

[src]

Create an angle from radians

`pub fn as_radians(&self) -> F`

[src]

Get the value of the angle as radians

`pub fn new_degrees(degrees: F) -> Angle<F>`

[src]

Create an angle from degrees

`pub fn from_degrees(degrees: F) -> Angle<F>`

[src]

Create an angle from degrees

`pub fn as_degrees(&self) -> F`

[src]

Get the value of the angle as degrees

`pub fn new_cycles(cycles: F) -> Angle<F>`

[src]

Create an angle from cycles (1 cycle is a full circle)

`pub fn from_cycles(cycles: F) -> Angle<F>`

[src]

Create an angle from cycles (1 cycle is a full circle)

`pub fn as_cycles(&self) -> F`

[src]

Get the value of the angle as number of cycles (full circles)

`pub fn of_vector(vec: &Vec2<F>) -> Angle<F>`

[src]

Get the angle that a given vector points in relative to the x-axis and going counterclockwise. This ranges from -PI to PI, and all 4 quadrants are properly handled.

## Trait Implementations

`impl<F: Debug> Debug for Angle<F>`

[src]

`fn fmt(&self, __arg_0: &mut Formatter) -> Result`

[src]

Formats the value using the given formatter. Read more

`impl<F: Clone> Clone for Angle<F>`

[src]

`fn clone(&self) -> Angle<F>`

[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<F: Copy> Copy for Angle<F>`

[src]

`impl<F: PartialEq> PartialEq for Angle<F>`

[src]

`fn eq(&self, __arg_0: &Angle<F>) -> bool`

[src]

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

`fn ne(&self, __arg_0: &Angle<F>) -> bool`

[src]

This method tests for `!=`

.

`impl<F: Eq> Eq for Angle<F>`

[src]

`impl<F: Hash> Hash for Angle<F>`

[src]

`fn hash<__HF: Hasher>(&self, __arg_0: &mut __HF)`

[src]

Feeds this value into the given [`Hasher`

]. Read more

`fn hash_slice<H>(data: &[Self], state: &mut H) where`

H: Hasher,

1.3.0[src]

H: Hasher,

Feeds a slice of this type into the given [`Hasher`

]. Read more

`impl<F: PartialOrd> PartialOrd for Angle<F>`

[src]

`fn partial_cmp(&self, __arg_0: &Angle<F>) -> Option<Ordering>`

[src]

This method returns an ordering between `self`

and `other`

values if one exists. Read more

`fn lt(&self, __arg_0: &Angle<F>) -> bool`

[src]

This method tests less than (for `self`

and `other`

) and is used by the `<`

operator. Read more

`fn le(&self, __arg_0: &Angle<F>) -> 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, __arg_0: &Angle<F>) -> bool`

[src]

This method tests greater than (for `self`

and `other`

) and is used by the `>`

operator. Read more

`fn ge(&self, __arg_0: &Angle<F>) -> bool`

[src]

This method tests greater than or equal to (for `self`

and `other`

) and is used by the `>=`

operator. Read more

`impl<F: Ord> Ord for Angle<F>`

[src]

`fn cmp(&self, __arg_0: &Angle<F>) -> Ordering`

[src]

This method returns an `Ordering`

between `self`

and `other`

. Read more

`fn max(self, other: Self) -> Self`

1.21.0[src]

Compares and returns the maximum of two values. Read more

`fn min(self, other: Self) -> Self`

1.21.0[src]

Compares and returns the minimum of two values. Read more

`impl<F: FullFloat> Mul<F> for Angle<F>`

[src]

`type Output = Angle<F>`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: F) -> Angle<F>`

[src]

Performs the `*`

operation.

`impl<F: FullFloat> Div<F> for Angle<F>`

[src]

`type Output = Angle<F>`

The resulting type after applying the `/`

operator.

`fn div(self, rhs: F) -> Angle<F>`

[src]

Performs the `/`

operation.

`impl<F: FullFloat> Add<Angle<F>> for Angle<F>`

[src]

`type Output = Angle<F>`

The resulting type after applying the `+`

operator.

`fn add(self, rhs: Angle<F>) -> Angle<F>`

[src]

Performs the `+`

operation.

`impl<F: FullFloat> Sub<Angle<F>> for Angle<F>`

[src]

`type Output = Angle<F>`

The resulting type after applying the `-`

operator.

`fn sub(self, rhs: Angle<F>) -> Angle<F>`

[src]

Performs the `-`

operation.

`impl<F: FullFloat> Neg for Angle<F>`

[src]

`type Output = Angle<F>`

The resulting type after applying the `-`

operator.

`fn neg(self) -> Angle<F>`

[src]

Performs the unary `-`

operation.

`impl<F: FullFloat> ApproxEq for Angle<F>`

[src]

`type Flt = F`

`fn approx_eq(`

&self,

other: &Self,

epsilon: <F as ApproxEq>::Flt,

ulps: <<F as ApproxEq>::Flt as Ulps>::U

) -> bool

[src]

&self,

other: &Self,

epsilon: <F as ApproxEq>::Flt,

ulps: <<F as ApproxEq>::Flt as Ulps>::U

) -> bool

This method tests for `self`

and `other`

values to be approximately equal using two methods: epsilon and ulps. If the values differ by less than the given epsilon, they will be considered equal. If the values differ by more than epsilon, but by less than the given ulps, they will also be considered equal. Otherwise they are unequal. Read more

`fn approx_ne(`

&self,

other: &Self,

epsilon: Self::Flt,

ulps: <Self::Flt as Ulps>::U

) -> bool

[src]

&self,

other: &Self,

epsilon: Self::Flt,

ulps: <Self::Flt as Ulps>::U

) -> bool

This method tests for `self`

and `other`

values to be not approximately equal using two methods: epsilon and ulps. If the values differ by less than the given epsilon, they will be considered equal. If the values differ by more than epsilon, but by less than the given ulps, they will also be considered equal. Otherwise they are unequal. Read more