Module: SunTime::DegreeTrig

Included in:
SunTime
Defined in:
lib/sun_time/degree_trig.rb

Instance Method Summary collapse

Instance Method Details

#acos(d) ⇒ Object



23
24
25
# File 'lib/sun_time/degree_trig.rb', line 23

def acos (d)
  r2d Math.acos(d)
end

#asin(d) ⇒ Object



15
16
17
# File 'lib/sun_time/degree_trig.rb', line 15

def asin (d)
 r2d Math.asin(d)
end

#atan(d) ⇒ Object



31
32
33
# File 'lib/sun_time/degree_trig.rb', line 31

def atan (d)
  r2d Math.atan(d)
end

#cos(d) ⇒ Object



19
20
21
# File 'lib/sun_time/degree_trig.rb', line 19

def cos (d)
  Math.cos(d2r(d))
end

#d2r(v) ⇒ Object



7
8
9
# File 'lib/sun_time/degree_trig.rb', line 7

def d2r (v)
  Math::PI/180 * v
end

#r2d(v) ⇒ Object



3
4
5
# File 'lib/sun_time/degree_trig.rb', line 3

def r2d (v)
  180/Math::PI * v 
end

#sin(d) ⇒ Object



11
12
13
# File 'lib/sun_time/degree_trig.rb', line 11

def sin (d)
  Math.sin(d2r(d))
end

#tan(d) ⇒ Object



27
28
29
# File 'lib/sun_time/degree_trig.rb', line 27

def tan (d)
  Math.tan(d2r(d))
end