struct Geode::Radians(T)

Overview

Unit type for an angle measured in radians.

The T type parameter is the type used to store the angle's value. It should be a numerical type, preferably Float32 or Float64.

Defined in:

geode/angles/radians.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Geode::Angle(T)

%(amount : Number) : Angle
%(other : self) : Number
%(other : Angle) : Number
%
, &*(amount : Number) : Angle &*, &+(other : self) : self &+, &-(other : self) : self &-, *(amount : Number) : Angle *, +(other : self) : self
+(other : Angle) : Angle
+
, -(other : self) : self
-(other : Angle) : Angle
- : self
-
, /(amount : Number) : Angle
/(other : self) : Number
/(other : Angle) : Number
/
, //(amount : Number) : Angle
//(other : self) : Number
//(other : Angle) : Number
//
, <=>(other : self)
<=>(other : Angle)
<=>
, abs : self abs, abs2 : self abs2, acute? acute?, ceil : self ceil, floor : self floor, fraction : self fraction, full? full?, lerp(other : self, t : Number) : self lerp, near_zero?(tolerance : self)
near_zero?(tolerance : Angle)
near_zero?(tolerance : Number)
near_zero?
, negative? negative?, normalize : self normalize, oblique? oblique?, obtuse? obtuse?, positive? positive?, reflex? reflex?, right? right?, round(mode : Number::RoundingMode = :ties_even) : self
round(digits : Number, base = 10, *, mode : Number::RoundingMode = :ties_even) : self
round
, sign sign, signed_normalize : self signed_normalize, straight? straight?, to_f : Float to_f, to_unsafe to_unsafe, value : T value, zero? zero?

Constructor methods inherited from struct Geode::Angle(T)

new(value : T) new, zero : self zero

Constructor Detail

def self.full : self #

Amount of radians to complete a full revolution (360 degrees).


[View source]
def self.half : self #

Amount of radians to complete a half revolution (180 degrees).


[View source]
def self.new(angle : Angle) : self #

Creates an angle by converting an existing one to radians.


[View source]
def self.new(value : T) #

Creates an angle from the specified value.


[View source]
def self.quarter : self #

Amount of radians to complete a quarter of a revolution (90 degrees).


[View source]
def self.third : self #

Amount of radians to complete a third of a revolution (120 degrees).


[View source]

Instance Method Detail

def to_degrees : Degrees #

Converts this angle to degrees.


[View source]
def to_gradians : Gradians #

Converts this angle to gradians.


[View source]
def to_radians : Radians #

Converts this angle to radians.

Simply returns self.


[View source]
def to_s(io : IO) : Nil #

Produces a string containing the angle.

The string is formatted as:

# rad

[View source]
def to_turns : Turns #

Converts this angle to turns.


[View source]