Method: ML::Data::Generator2D.point_from_line

Defined in:
lib/data/generator.rb

.point_from_line(coef, x) ⇒ Array

Generate point from line

Parameters:

  • coef (Array)
    a,b,c

    for ax+by+c=0

  • x (Number)

    x value

Returns:

  • (Array)

    point



12
13
14
# File 'lib/data/generator.rb', line 12

def self.point_from_line coef, x
  [x, (-coef[2]-(coef[0] * x))/coef[1]]
end