Difference between revisions of "Spline Command"
From GeoGebra Manual
m (Fix typo) |
m (style) |
||
Line 5: | Line 5: | ||
:Creates a spline with given order through all points. | :Creates a spline with given order through all points. | ||
;Spline( <List of Points>, <Order ≥ 3>, <Weight Function> ) | ;Spline( <List of Points>, <Order ≥ 3>, <Weight Function> ) | ||
− | :Creates a spline with given order through all points. The weight function says what should be the difference of t values for point P<sub>i</sub> and P<sub>i+1</sub> given their difference P<sub>i+1</sub>-P<sub>i</sub>=(x,y). To get the spline you expect from "function" algorithm you should use <code>abs(x)+0*y</code>, to get the GeoGebra's default spline you can use <code>sqrt(x^2+y^2)</code>. | + | :Creates a spline with given order through all points. The weight function says what should be the difference of ''t'' values for point ''P''<sub>i</sub> and ''P''<sub>i+1</sub> given their difference ''P''<sub>i+1</sub> - ''P''<sub>i</sub> = (''x'', ''y''). To get the spline you expect from "function" algorithm you should use <code>abs(x)+0*y</code>, to get the GeoGebra's default spline you can use <code>sqrt(x^2+y^2)</code>. |
− | :{{Note|The choice of default makes the result behave nicely when transformed, making sure that <code>Rotate(Spline(list), a)</code> gives the same as <code>Spline( | + | :{{Note|The choice of default makes the result behave nicely when transformed, making sure that <code>Rotate(Spline(list), a)</code> gives the same as <code>Spline(Rotate(list, a))</code>.}} |
Latest revision as of 08:54, 30 July 2020
- Spline( <List of Points> )
- Creates a cubic spline through all points.
- Spline( <List of Points>, <Order ≥ 3> )
- Creates a spline with given order through all points.
- Spline( <List of Points>, <Order ≥ 3>, <Weight Function> )
- Creates a spline with given order through all points. The weight function says what should be the difference of t values for point Pi and Pi+1 given their difference Pi+1 - Pi = (x, y). To get the spline you expect from "function" algorithm you should use
abs(x)+0*y
, to get the GeoGebra's default spline you can usesqrt(x^2+y^2)
. - Note: The choice of default makes the result behave nicely when transformed, making sure that
Rotate(Spline(list), a)
gives the same asSpline(Rotate(list, a))
.
Comments
The result of the spline command is a curve. Spline algorithm is used for x and y coordinates separately: first we determine values of t that correspond to the points (based on Euclidian distances between the points), then we find cubic splines as functions t->x and t->y.