Module: Proj4::Tools

Extended by:
Tools
Included in:
Projection, Tools
Defined in:
lib/ffi-proj4/tools.rb

Instance Method Summary collapse

Instance Method Details

#bool_result(r) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/ffi-proj4/tools.rb', line 4

def bool_result(r)
  case r
    when 1
      true
    when 0
      false
    else
      raise RuntimeError.new("Unexpected boolean result: #{r}")
  end
end

#deg_to_rad(deg) ⇒ Object



19
20
21
# File 'lib/ffi-proj4/tools.rb', line 19

def deg_to_rad(deg)
  deg * Proj4::DEG_TO_RAD
end

#rad_to_deg(rad) ⇒ Object



15
16
17
# File 'lib/ffi-proj4/tools.rb', line 15

def rad_to_deg(rad)
  rad * Proj4::RAD_TO_DEG
end