1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-28 18:49:57 +02:00
This commit is contained in:
Pomax
2020-01-21 09:29:02 +01:00
parent 01ab2695ee
commit 6dba3755e9
6 changed files with 14 additions and 8 deletions

View File

@@ -28,17 +28,20 @@ module.exports = {
return {x:wp*t/tf, y:p.x};
});
api.drawLine({x:0,y:0}, {x:0,y:h}, offset);
api.drawAxes(pad, "t",0,1, "x",0,w, offset);
api.drawAxes(pad, "t",0,1, "x",0,w-pad, offset);
offset.x += pad;
offset.y += pad;
api.drawCurve(new api.Bezier(x_pts), offset);
offset.x += w-pad;
offset.y -= pad;
var y_pts = JSON.parse(JSON.stringify(pts)).map((p,t) => {
return {x:wp*t/tf, y:p.y};
});
api.drawLine({x:0,y:0}, {x:0,y:h}, offset);
api.drawAxes(pad, "t",0,1, "y",0,w, offset);
api.drawAxes(pad, "t",0,1, "y",0,w-pad, offset);
offset.x += pad;
offset.y += pad;
api.drawCurve(new api.Bezier(y_pts), offset);
}
};