EasingFunction.Linear


public final class EasingFunction.Linear extends EasingFunction


Parameters for a custom piecewise-linear easing function.

A piecewise-linear function is defined by a sequence of points; the value of the function at an x-position equal to one of those points is equal to the y-position of that point, and the value of the function at an x-position between two points is equal to the linear interpolation between those points' y-positions. This easing function implicitly includes the points (0, 0) and (1, 1), so the points field below need only include any points between those. If points is empty, then this function is equivalent to the Predefined.LINEAR identity function.

To be valid, all y-positions must be finite, and all x-positions must be in the range 0, 1 and must be monotonically non-decreasing. It is valid for multiple points to have the same x-position, in order to create a discontinuity in the function; in that case, the value of the function at exactly that x-position is equal to the y-position of the last of these points.

If the input x-value is outside the interval 0, 1, the output will be extrapolated from the first/last line segment.

Summary

Public constructors

Creates a new Linear easing function.

Public methods

boolean
equals(Object other)
final @NonNull List<@NonNull ImmutableVec>

An immutable list of the points that define the piecewise-linear function.

int
@NonNull String

Public constructors

Linear

Added in 1.1.0-alpha03
public Linear(@NonNull List<@NonNull ImmutableVec> points)

Creates a new Linear easing function.

Parameters
@NonNull List<@NonNull ImmutableVec> points

The points that define the piecewise-linear function.

Public methods

equals

public boolean equals(Object other)

getPoints

Added in 1.1.0-alpha03
public final @NonNull List<@NonNull ImmutableVecgetPoints()

An immutable list of the points that define the piecewise-linear function.

hashCode

public int hashCode()

toString

public @NonNull String toString()