EasingFunction.CubicBezier



Parameters for a custom cubic Bezier easing function.

A cubic Bezier is generally defined by four points, P0 - P3. In the case of the easing function, P0 is defined to be the point (0, 0), and P3 is defined to be the point (1, 1). The values of x1 and x2 are required to be in the range 0, 1. This guarantees that the resulting curve is a function with respect to x and follows the CSS specification

Valid parameters must have all finite values, and x1 and x2 must be in the interval 0, 1.

Input x values that are outside the interval 0, 1 will be clamped, but output values will not. This is somewhat different from the w3c defined cubic Bezier that allows extrapolated values outside x in 0, 1 by following end-point tangents.

Summary

Public constructors

CubicBezier(
    x1: @FloatRange(from = 0.0, to = 1.0) Float,
    y1: Float,
    x2: @FloatRange(from = 0.0, to = 1.0) Float,
    y2: Float
)

Creates a new CubicBezier easing function.

Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

Float

The x-coordinate of the first control point.

Cmn
Float

The x-coordinate of the second control point.

Cmn
Float

The y-coordinate of the first control point.

Cmn
Float

The y-coordinate of the second control point.

Cmn

Public constructors

CubicBezier

CubicBezier(
    x1: @FloatRange(from = 0.0, to = 1.0) Float,
    y1: Float,
    x2: @FloatRange(from = 0.0, to = 1.0) Float,
    y2: Float
)

Creates a new CubicBezier easing function.

Parameters
x1: @FloatRange(from = 0.0, to = 1.0) Float

The x-coordinate of the first control point. Must be in the range 0, 1.

y1: Float

The y-coordinate of the first control point.

x2: @FloatRange(from = 0.0, to = 1.0) Float

The x-coordinate of the second control point. Must be in the range 0, 1.

y2: Float

The y-coordinate of the second control point.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

x1

val x1Float

The x-coordinate of the first control point. Must be in the range 0, 1.

x2

val x2Float

The x-coordinate of the second control point. Must be in the range 0, 1.

y1

val y1Float

The y-coordinate of the first control point.

y2

val y2Float

The y-coordinate of the second control point.