1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-30 19:50:01 +02:00

polybezier

This commit is contained in:
Pomax
2016-01-10 13:46:59 -08:00
parent d6a335006e
commit 3c190e630c
7 changed files with 416 additions and 99 deletions

View File

@@ -46,6 +46,7 @@ var Projections = React.createClass({
api.drawCurve(curve);
if (api.mousePt) {
api.setColor("red");
api.setFill("red");
api.drawCircle(api.mousePt, 3);
// naive t value
var t = this.findClosest(api._lut, api.mousePt, api.utils.dist);
@@ -53,6 +54,7 @@ var Projections = React.createClass({
var p = curve.get(t);
api.drawLine(p, api.mousePt);
api.drawCircle(p, 3);
api.text("t = "+api.utils.round(t,2), p, {x:10, y:3});
}
},