# Difference between revisions of "Spline Command"

From GeoGebra Manual

m (Text replace - ";(.*)\[(.*)\]" to ";$1($2)") |
m (Fix typo) |
||

(One intermediate revision by the same user not shown) | |||

Line 4: | Line 4: | ||

;Spline( <List of Points>, <Order ≥ 3> ) | ;Spline( <List of Points>, <Order ≥ 3> ) | ||

: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> ) | ||

+ | :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(rotate(list, a))</code>.}} |

## Revision as of 00:40, 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 P
_{i}and P_{i+1}given their difference P_{i+1}-P_{i}=(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 use`sqrt(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 as`Spline(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.