Method: Suntrack::RAstro.get_dms

Defined in:
lib/suntrack/RAstro.rb

.get_dms(ddd) ⇒ Object

Utility method to get degrees/minutes/seconds from decimal degrees. M&P, page 11



52
53
54
55
56
57
58
59
60
# File 'lib/suntrack/RAstro.rb', line 52

def self.get_dms(ddd)
  pt = Suntrack::Point3D.new(0,0,0)
  pt.x = ddd.abs.to_i
  d1 = (ddd.abs - pt.x) * 60
  pt.y = d1.to_i
  pt.z = (d1 - pt.y) * 60
  pt.x = -pt.x if ddd < 0
  pt
end