module PrayerTimes::MathHelpers

Math helpers module

Public Instance Methods

darccos(x) click to toggle source

Calculates arccos in degrees @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 38
def darccos(x); degrees Math.acos(x) ; end
darccot(x) click to toggle source

Calculates arccot in degrees @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 48
def darccot(x); degrees Math.atan(1.0/x) ; end
darcsin(x) click to toggle source

Calculates arcsin in degrees @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 33
def darcsin(x); degrees Math.asin(x) ; end
darctan(x) click to toggle source

Calculates arctan in degrees @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 43
def darctan(x); degrees Math.atan(x) ; end
darctan2(y, x) click to toggle source

Calculates arctan2 in degrees @param [Float] x @param [Float] y @return [Float]

# File lib/prayer_times/math_helpers.rb, line 54
def darctan2(y, x); degrees Math.atan2(y, x) ; end
degrees(x) click to toggle source

Calculates degrees from radians @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 13
def degrees(x) ; x * 180/Math::PI ; end
radians(x) click to toggle source

Calculates radians from degrees @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 8
def radians(x) ; x * Math::PI/180 ; end
rcos(x) click to toggle source

Calculates cos in radians @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 23
def rcos(x); Math.cos(radians x) ; end
rsin(x) click to toggle source

Calculates sin in radians @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 18
def rsin(x); Math.sin(radians x) ; end
rtan(x) click to toggle source

Calculates tan in radians @param [Float] x @return [Float]

# File lib/prayer_times/math_helpers.rb, line 28
def rtan(x); Math.tan(radians x) ; end