Class: Proj4::Point
Instance Attribute Summary collapse
-
#x ⇒ Object
(also: #lon)
Returns the value of attribute x.
-
#y ⇒ Object
(also: #lat)
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Instance Method Summary collapse
-
#initialize(x, y, z = nil) ⇒ Point
constructor
A new instance of Point.
- #to_deg ⇒ Object
- #to_deg! ⇒ Object
- #to_rad ⇒ Object
- #to_rad! ⇒ Object
Methods included from Tools
#bool_result, #deg_to_rad, #deg_to_rad!, #rad_to_deg, #rad_to_deg!
Constructor Details
#initialize(x, y, z = nil) ⇒ Point
Returns a new instance of Point.
7 8 9 |
# File 'lib/ffi-proj4/point.rb', line 7 def initialize(x, y, z = nil) @x, @y, @z = x, y, z end |
Instance Attribute Details
#x ⇒ Object Also known as: lon
Returns the value of attribute x.
5 6 7 |
# File 'lib/ffi-proj4/point.rb', line 5 def x @x end |
#y ⇒ Object Also known as: lat
Returns the value of attribute y.
5 6 7 |
# File 'lib/ffi-proj4/point.rb', line 5 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
5 6 7 |
# File 'lib/ffi-proj4/point.rb', line 5 def z @z end |
Instance Method Details
#to_deg ⇒ Object
23 24 25 |
# File 'lib/ffi-proj4/point.rb', line 23 def to_deg self.dup.to_deg! end |
#to_deg! ⇒ Object
16 17 18 19 20 21 |
# File 'lib/ffi-proj4/point.rb', line 16 def to_deg! self.x = rad_to_deg(self.x) self.y = rad_to_deg(self.y) self.z = rad_to_deg(self.z) unless self.z.nil? self end |
#to_rad ⇒ Object
34 35 36 |
# File 'lib/ffi-proj4/point.rb', line 34 def to_rad self.dup.to_rad! end |
#to_rad! ⇒ Object
27 28 29 30 31 32 |
# File 'lib/ffi-proj4/point.rb', line 27 def to_rad! self.x = deg_to_rad(self.x) self.y = deg_to_rad(self.y) self.z = deg_to_rad(self.z) unless self.z.nil? self end |