goog.math.Bezier
Classgoog.math.Bezier(x0, y0, x1, y1, x2, y2, x3, y3)
Object representing a cubic bezier curve.
x0
{number
}
y0
{number
}
x1
{number
}
y1
{number
}
x2
{number
}
y2
{number
}
x3
{number
}
y3
{number
}
.KAPPA
{number
}Constant used to approximate ellipses. See: http://canvaspaint.org/blog/2006/12/ellipse/
.clone()
goog.math.Bezier
}
.equals(other)
Test if the given curve is exactly the same as this one.
other
{goog.math.Bezier
}
boolean
}
.flip()
Modifies the curve in place to progress in the opposite direction.
.getPoint(t)
Computes the curve at a point between 0 and 1.
t
{number
}
goog.math.Coordinate
}
.solvePositionFromXValue(xVal)
Computes the position t of a point on the curve given its x coordinate. That is, for an input xVal, finds t s.t. getPoint(t).x = xVal. As such, the following should always be true up to some small epsilon: t ~ solvePositionFromXValue(getPoint(t).x) for t in [0, 1].
xVal
{number
}
number
}
.solveYValueFromXValue(xVal)
Computes the y coordinate of a point on the curve given its x coordinate.
xVal
{number
}
number
}
.subdivide(s, t)
Changes this curve in place to be the portion of itself from [s, t].
s
{number
}
t
{number
}
.subdivideLeft(t)
Changes this curve in place to be the portion of itself from [t, 1].
t
{number
}
.subdivideRight(t)
Changes this curve in place to be the portion of itself from [0, t].
t
{number
}
.x0
{number
}X coordinate of the first point.
.x1
{number
}X coordinate of the first control point.
.x2
{number
}X coordinate of the second control point.
.x3
{number
}X coordinate of the end point.
.y0
{number
}Y coordinate of the first point.
.y1
{number
}Y coordinate of the first control point.
.y2
{number
}Y coordinate of the second control point.
.y3
{number
}Y coordinate of the end point.