class LinearEquation

Attributes

a[RW]
b[RW]
c[RW]

Public Class Methods

new(a, b, c) click to toggle source
# File lib/geometry_3d/equation.rb, line 6
def initialize(a, b, c)
  @a = a
  @b = b
  @c = c
end

Public Instance Methods

solve_system(equation) click to toggle source
# File lib/geometry_3d/equation.rb, line 12
def solve_system(equation)
  y = (equation.a * c - a * equation.c) / (a * equation.b - equation.a * b).to_f
  x = (- c - b * y) / a.to_f
  [x, y]
end