Method: EhbGameLib::Math::Line.new_by_coordinates

Defined in:
lib/ehb_game_lib/math/line.rb

.new_by_coordinates(x0, y0, x1, y1) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/ehb_game_lib/math/line.rb', line 7

def new_by_coordinates(x0, y0, x1, y1)
  new(
    y1 - y0,
    x0 - x1,
    y0 * x1 + x0 * y0 - x0 * y1 - y0 * x0
  )
end