コンテンツにスキップ

Angle

このコンテンツはまだ日本語訳がありません。

Defined in: mod.rs:142

pub struct Angle\<U: [AngleUnit](../../traits/angleunit/)\>

A scalar angle tagged with its unit U.

Angle<U> is #[repr(transparent)] around f64 so it compiles to a bare float at runtime. Arithmetic operators are implemented between angles of the same unit only; conversions are explicit via Angle::to_radians. Clone and Copy are implemented manually so that they do not require the unit markers (Radians, Arcseconds, …) to be Clone / Copy themselves — those markers are pure phantom types and deliberately carry no derives.

const fn new(value: f64) -> Self

Construct an angle directly from a raw scalar value interpreted in the unit U.


const fn raw(self) -> f64

Return the raw underlying value, interpreted in the unit U.


const fn zero() -> Self

The zero angle in this unit.


fn to_radians(self) -> Rad

Convert to radians. Multiplies by U::TO_RADIANS.


fn is_finite(self) -> bool

True if the wrapped f64 is finite.


fn sin(self) -> f64

Sine of the angle.


fn cos(self) -> f64

Cosine of the angle.


fn tan(self) -> f64

Tangent of the angle.