Module: Breasal::Utils

Included in:
EastingNorthing, LatLng
Defined in:
lib/breasal/utils.rb

Instance Method Summary collapse

Instance Method Details

#cos_pow_2(x) ⇒ Object



17
18
19
# File 'lib/breasal/utils.rb', line 17

def cos_pow_2(x)
  Math.cos(x) * Math.cos(x)
end

#deg_to_rad(degrees) ⇒ Object



5
6
7
# File 'lib/breasal/utils.rb', line 5

def deg_to_rad(degrees)
  degrees / 180.0 * Math::PI
end

#rad_to_deg(r) ⇒ Object



9
10
11
# File 'lib/breasal/utils.rb', line 9

def rad_to_deg(r)
  (r/Math::PI)*180
end

#sec(x) ⇒ Object



25
26
27
# File 'lib/breasal/utils.rb', line 25

def sec(x)
  1.0 / Math.cos(x)
end

#sin_pow_2(x) ⇒ Object



13
14
15
# File 'lib/breasal/utils.rb', line 13

def sin_pow_2(x)
  Math.sin(x) * Math.sin(x)
end

#tan_pow_2(x) ⇒ Object



21
22
23
# File 'lib/breasal/utils.rb', line 21

def tan_pow_2(x)
  Math.tan(x) * Math.tan(x)
end