A quadratic curve can be thought of as a segment of a parabola (with arbitrary orientation). The code below draws such a parabola segment.
To help you understand how this works, set the variable explain
to true
in the
window and then read the following.
Consider 3 points
A = (x1, y1)
,
C = (x2, y2)
, and
B = (x3, y3)
.
The starting point is A; C is known as the control point and B is the end point. The quadratic curve goes through A and B in such a way that it is tangent at A to the line segment that joins A and C; it is also tangent at B to the line segment that joins B and C.
The syntax to create a quadratic curve is
A quadratic curve is an example of a Bézier curve. Some interesting animations can be found on that Wikipedia page.
[The following table has been adapted from Wikipedia.]
|
|
|
Keep your personal notes here. These notes are stored by your browser on your own computer, and will be available from any page on this site. You can choose to use html syntax for formatting.