CPCurve

org.cosplay.CPCurve$
object CPCurve

Set of utilities for interpolation functions.

Attributes

Source
CPCurve.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
CPCurve.type

Members list

Value members

Concrete methods

def colorGradient(c1: CPColor, c2: CPColor, steps: Int): () => CPColor

Creates a function that produces a color that is a gradient from the given parameters. Each call to the returned function will produce a color that is an incremental shift from color c1 to color c2.

Creates a function that produces a color that is a gradient from the given parameters. Each call to the returned function will produce a color that is an incremental shift from color c1 to color c2.

Value parameters

c1

Start of the gradient color.

c2

End of the gradient color.

steps

Number of steps of the gradient. Returned function will cycle back and will start from the beginning of the gradient if it is called more than steps times.

Attributes

Returns

Gradient producing function.

See also
Source
CPCurve.scala
def lagrangePoly(points: Seq[(Float, Float)]): Float => Float

Gets a function that is a polynomial Lagrange interpolation for the given set of interpolating points.

Gets a function that is a polynomial Lagrange interpolation for the given set of interpolating points.

Value parameters

points

Lagrange interpolation points (abscissas and function values).

Attributes

Returns

Polynomial Lagrange interpolation for the given set of interpolating points.

See also
Source
CPCurve.scala
def linearGradient(f1: Float, f2: Float, steps: Int): () => Float

Gets a linear gradient function for given two values.

Gets a linear gradient function for given two values.

Value parameters

f1

Inclusive start of the gradient.

f2

Inclusive end of the gradient.

steps

Number of steps in gradient interpolation.

Attributes

Returns

Linear gradient function for given two values.

Source
CPCurve.scala