LinearEquation

data class LinearEquation(val initialTime: Duration, val initialValue: Double, val rate: Double)

A linear equation in point-slope form.

Constructors

Link copied to clipboard
constructor(constant: Number)

Creates a constant linear equation at a given value.

constructor(initialTime: Duration, initialValue: Double, rate: Double)

Properties

Link copied to clipboard
val initialTime: Duration

The time of the start point.

Link copied to clipboard

The value of the start point.

Link copied to clipboard

The rate of change, in units per second.

Functions

Link copied to clipboard
fun abs(): Real

Calculates the absolute value of this equation, as a real profile.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun findRoot(): Duration?

Finds the time that this equation is zero, or null if it does not cross the axis.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Calculates when this is equal to another linear equation, as a Booleans object.

Link copied to clipboard

Calculates when this is greater than another linear equation, as a Booleans object.

Link copied to clipboard

Calculates when this is greater than or equal to another linear equation, as a Booleans object.

Link copied to clipboard

Calculates when this is less than another linear equation, as a Booleans object.

Link copied to clipboard

Calculates when this is less than or equal to another linear equation, as a Booleans object.

Link copied to clipboard

Calculates when this is not equal to another linear equation, as a Booleans object.

Link copied to clipboard
Link copied to clipboard
fun shiftInitialTime(newInitialTime: Duration): LinearEquation

Returns an equivalent equation that is represented at a different start time.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun valueAt(time: Duration): Double

Calculates the value at a given time.