module Determinator

Public Instance Methods

center() click to toggle source
# File lib/cartesius/determinator.rb, line 3
def center
  Cartesius::Point.new(
      x: Rational(-@x_coeff, (2 * @x2_coeff)),
      y: Rational(-@y_coeff, (2 * @y2_coeff))
  )
end
to_equation() click to toggle source
# File lib/cartesius/determinator.rb, line 10
def to_equation
  equationfy(
      'x^2' => @x2_coeff, 'y^2' => @y2_coeff, 'x' => @x_coeff, 'y' => @y_coeff, '1' => @k_coeff
  )
end

Private Instance Methods

a2() click to toggle source
# File lib/cartesius/determinator.rb, line 18
def a2
  Rational((determinator - @k_coeff).abs, (@x2_coeff).abs)
end
b2() click to toggle source
# File lib/cartesius/determinator.rb, line 22
def b2
  Rational((determinator - @k_coeff).abs, (@y2_coeff).abs)
end
determinator() click to toggle source
# File lib/cartesius/determinator.rb, line 26
def determinator
  (@x2_coeff * (center.x**2)) + (@y2_coeff * (center.y**2))
end