Class: Ellipsoid

Inherits:
Object
  • Object
show all
Defined in:
lib/grid_ref.rb

Overview

adapted from Geography::NationalGrid by and © P Kent with reference to the Ordnance Survey guide to coordinate systems in the UK www.ordnancesurvey.co.uk/oswebsite/gps/information/coordinatesystemsinfo/guidecontents/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a, b) ⇒ Ellipsoid

Returns a new instance of Ellipsoid.



8
9
10
11
# File 'lib/grid_ref.rb', line 8

def initialize(a,b)
  @a = a
  @b = b
end

Instance Attribute Details

#aObject

Returns the value of attribute a.



6
7
8
# File 'lib/grid_ref.rb', line 6

def a
  @a
end

#bObject

Returns the value of attribute b.



6
7
8
# File 'lib/grid_ref.rb', line 6

def b
  @b
end

#e2Object

Returns the value of attribute e2.



6
7
8
# File 'lib/grid_ref.rb', line 6

def e2
  @e2
end

Instance Method Details

#eccObject



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

def ecc
  (a**2 - b**2)/(a**2)
end