Class: RubyVor::Point

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x = 0.0, y = 0.0) ⇒ Point

Returns a new instance of Point.



4
5
6
7
# File 'lib/ruby_vor/point.rb', line 4

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

Instance Attribute Details

#xObject

Returns the value of attribute x.



3
4
5
# File 'lib/ruby_vor/point.rb', line 3

def x
  @x
end

#yObject

Returns the value of attribute y.



3
4
5
# File 'lib/ruby_vor/point.rb', line 3

def y
  @y
end

Class Method Details

.test_largeObject



10
11
12
13
14
15
16
# File 'lib/ruby_vor/point.rb', line 10

def test_large
  a = []
  1000000.times {
    a << new(100000.0 * rand, 100000.0 * rand)
  }
  a
end