1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-02 04:42:43 +02:00
This commit is contained in:
Pomax
2020-09-05 22:50:12 -07:00
parent bec07e3297
commit 9434a71d34
46 changed files with 1795 additions and 1623 deletions

View File

@@ -1,7 +1,7 @@
let curve, r;
setup() {
r = (this.width/4) | 0;
r = 100;
curve = new Bezier(this, [
{ x: r, y: 0 },
{ x: r, y: 0.55228 * r },

View File

@@ -179,4 +179,4 @@ Which, in decimal values, rounded to six significant digits, is:
Of course, this is for a circle with radius 1, so if you have a different radius circle, simply multiply the coordinate by the radius you need. And then finally, forming a full curve is now a simple a matter of mirroring these coordinates about the origin:
<graphics-element title="Cubic Bézier circle approximation" width="400" height="400" src="./circle.js"></graphics-element>
<graphics-element title="Cubic Bézier circle approximation" width="340" height="300" src="./circle.js"></graphics-element>