Class: Kamelopard::Functions::Line

Inherits:
Cubic show all
Defined in:
lib/kamelopard/function.rb

Overview

Describes a line

Instance Attribute Summary

Attributes inherited from Cubic

#c0, #c1, #c2, #c3

Attributes inherited from Function

#append, #compose, #end, #max, #min, #start, #verbose

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Cubic

#run_function

Methods inherited from Function1D

#compose=

Methods inherited from Function

#get_value, #run_function

Constructor Details

#initialize(c1 = 1.0, c0 = 0.0, min = 0.0, max = 1.0) ⇒ Line

Returns a new instance of Line.



152
153
154
# File 'lib/kamelopard/function.rb', line 152

def initialize(c1 = 1.0, c0 = 0.0, min = 0.0, max = 1.0)
    super(0.0, 0.0, c1, c0, min, max)
end

Class Method Details

.interpolate(a, b) ⇒ Object



156
157
158
# File 'lib/kamelopard/function.rb', line 156

def self.interpolate(a, b)
    return Line.new(b - a, a)
end