CubicBezierEasing
-
Cmn
class CubicBezierEasing : Easing
A cubic polynomial easing.
The CubicBezierEasing
class implements third-order Bézier curves.
This is equivalent to the Android PathInterpolator
when a single cubic Bézier curve is specified.
Note: CubicBezierEasing
instances are stateless and can be used concurrently from multiple threads.
Rather than creating a new instance, consider using one of the common cubic Easing
s:
Summary
Public constructors |
|
---|---|
CubicBezierEasing(a: Float, b: Float, c: Float, d: Float) |
Cmn
|
Public functions |
||
---|---|---|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
open String |
toString() |
Cmn
|
open Float |
Transforms the specified |
Cmn
|
Public constructors
CubicBezierEasing
CubicBezierEasing(a: Float, b: Float, c: Float, d: Float)
Parameters | |
---|---|
a: Float |
The x coordinate of the first control point. The line through the point (0, 0) and the first control point is tangent to the easing at the point (0, 0). |
b: Float |
The y coordinate of the first control point. The line through the point (0, 0) and the first control point is tangent to the easing at the point (0, 0). |
c: Float |
The x coordinate of the second control point. The line through the point (1, 1) and the second control point is tangent to the easing at the point (1, 1). |
d: Float |
The y coordinate of the second control point. The line through the point (1, 1) and the second control point is tangent to the easing at the point (1, 1). |
Public functions
transform
open fun transform(fraction: Float): Float
Transforms the specified fraction
in the range 0..1 by this cubic Bézier curve. To solve the curve, fraction
is used as the x coordinate along the curve, and the corresponding y coordinate on the curve is returned. If no solution exists, this method throws an IllegalArgumentException
.
Throws | |
---|---|
kotlin.IllegalArgumentException |
If the cubic Bézier curve cannot be solved |