math.Bezier Extends
Object representing a cubic bezier curve.

Inheritance

Constructor

goog.math.Bezier(x0y0x1y1x2y2x3y3)

Parameters

x0 : number
X coordinate of the start point.
y0 : number
Y coordinate of the start point.
x1 : number
X coordinate of the first control point.
y1 : number
Y coordinate of the first control point.
x2 : number
X coordinate of the second control point.
y2 : number
Y coordinate of the second control point.
x3 : number
X coordinate of the end point.
y3 : number
Y coordinate of the end point.

Instance Methods

Public Protected Private
clone() !goog.math.Bezier
No description.
Returns: !goog.math.Bezier  A copy of this curve.
code »
equals(other) boolean
Test if the given curve is exactly the same as this one.
Arguments:
other : goog.math.Bezier
The other curve.
Returns: boolean  Whether the given curve is the same as this one.
code »
flip()
Modifies the curve in place to progress in the opposite direction.
code »
getPoint(t) !goog.math.Coordinate
Computes the curve at a point between 0 and 1.
Arguments:
t : number
The point on the curve to find.
Returns: !goog.math.Coordinate  The computed coordinate.
code »
getPointX(t) number
Computes the curve's X coordinate at a point between 0 and 1.
Arguments:
t : number
The point on the curve to find.
Returns: number  The computed coordinate.
code »
getPointY(t) number
Computes the curve's Y coordinate at a point between 0 and 1.
Arguments:
t : number
The point on the curve to find.
Returns: number  The computed coordinate.
code »
solvePositionFromXValue(xVal) number
Computes the position t of a point on the curve given its x coordinate. That is, for an input xVal, finds t s.t. getPointX(t) = xVal. As such, the following should always be true up to some small epsilon: t ~ solvePositionFromXValue(getPointX(t)) for t in [0, 1].
Arguments:
xVal : number
The x coordinate of the point to find on the curve.
Returns: number  The position t.
code »
solveYValueFromXValue(xVal) number
Computes the y coordinate of a point on the curve given its x coordinate.
Arguments:
xVal : number
The x coordinate of the point on the curve.
Returns: number  The y coordinate of the point on the curve.
code »
subdivide(st)
Changes this curve in place to be the portion of itself from [s, t].
Arguments:
s : number
The start of the desired portion of the curve.
t : number
The end of the desired portion of the curve.
code »
subdivideLeft(t)
Changes this curve in place to be the portion of itself from [t, 1].
Arguments:
t : number
The start of the desired portion of the curve.
code »
subdivideRight(t)
Changes this curve in place to be the portion of itself from [0, t].
Arguments:
t : number
The end of the desired portion of the curve.
code »

Instance Properties

x0 :
X coordinate of the first point.
Code »
x1 :
X coordinate of the first control point.
Code »
x2 :
X coordinate of the second control point.
Code »
x3 :
X coordinate of the end point.
Code »
y0 :
Y coordinate of the first point.
Code »
y1 :
Y coordinate of the first control point.
Code »
y2 :
Y coordinate of the second control point.
Code »
y3 :
Y coordinate of the end point.
Code »

Static Properties

goog.math.Bezier.KAPPA :
Constant used to approximate ellipses. See: http://canvaspaint.org/blog/2006/12/ellipse/
Code »

Package math

Package Reference