Class: WrfLibrary::Entity::Coordinate

Inherits:
Object
  • Object
show all
Defined in:
lib/wrf_library/entity/coordinate.rb

Overview

Simple coordinate class, that can have any combination of numbers for the considered tupel:

  • (int, int) indicates a coordinate on a grid as (x,y)

  • (float, float) indicates a geo coordinate as (lon, lat)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y) ⇒ Coordinate

initialization

Parameters:

  • x (Number)

    the first coordinate of the tupel

  • y (Number)

    the second coordinate of the tupel



21
22
23
24
# File 'lib/wrf_library/entity/coordinate.rb', line 21

def initialize(x, y)
  @x = x
  @y = y
end

Instance Attribute Details

#xNumber (readonly)

Returns the first coordinate of the tupel, commonly the abscissa.

Returns:

  • (Number)

    the first coordinate of the tupel, commonly the abscissa



14
15
16
# File 'lib/wrf_library/entity/coordinate.rb', line 14

def x
  @x
end

#yNumber (readonly)

Returns the second coordinate of the tupel, commonly the ordinate.

Returns:

  • (Number)

    the second coordinate of the tupel, commonly the ordinate



16
17
18
# File 'lib/wrf_library/entity/coordinate.rb', line 16

def y
  @y
end