# Difference between revisions of "Vertex equations of a quadratic function and it's inverse"

From JSXGraph Wiki

Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||

Line 1: | Line 1: | ||

A parabola can be uniquely defined by its vertex ''V'' and one more point ''P''. | A parabola can be uniquely defined by its vertex ''V'' and one more point ''P''. | ||

The function term of the parabola then has the form | The function term of the parabola then has the form | ||

− | :<math> | + | :<math>y = a \cdot (v-v_x)^2 + v_y</math> |

+ | |||

<jsxgraph width="300" height="300" box="box1"> | <jsxgraph width="300" height="300" box="box1"> |

## Revision as of 11:25, 16 December 2014

A parabola can be uniquely defined by its vertex *V* and one more point *P*.
The function term of the parabola then has the form

- [math]y = a \cdot (v-v_x)^2 + v_y[/math]

### JavaScript code

```
var b = JXG.JSXGraph.initBoard('box1', {boundingbox: [-5, 5, 5, -5], grid:true});
var v = b.create('point', [0,0], {name:'V'}),
p = b.create('point', [3,3], {name:'P'}),
f = b.create('functiongraph', [
function(x) {
var den = p.X()- v.X(),
a = (p.Y() - v.Y()) / (den * den);
return a * (x - v.X()) * (x - v.X()) + v.Y();
}]);
})();
```

### JavaScript code

```
var b = JXG.JSXGraph.initBoard('box2', {boundingbox: [-5, 5, 5, -5], grid:true});
var v = b.create('point', [0,0], {name:'V'}),
p = b.create('point', [3,3], {name:'P'}),
f = b.create('functiongraph', [
function(x) {
var den = p.Y()- v.Y(),
a = (p.X() - v.X()) / (den * den);
return Math.sqrt((x - v.X()) / a) + v.Y();
}]);
```