Skip to content

Commit

Permalink
v.1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
foo123 committed Nov 29, 2024
1 parent cc2b65f commit e928d85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 33 deletions.
24 changes: 7 additions & 17 deletions build/Geometrize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* Geometrize
* computational geometry and rendering library for JavaScript
*
* @version 1.0.1 (2024-11-29 17:00:43)
* @version 1.0.1 (2024-11-29 18:10:26)
* https://github.com/foo123/Geometrize
*
**//**
* Geometrize
* computational geometry and rendering library for JavaScript
*
* @version 1.0.1 (2024-11-29 17:00:43)
* @version 1.0.1 (2024-11-29 18:10:26)
* https://github.com/foo123/Geometrize
*
**/
Expand Down Expand Up @@ -2855,22 +2855,12 @@ var CBezier = makeClass(Bezier2D, {
x1 = p[1].x, y1 = p[1].y,
x2 = p[2].x, y2 = p[2].y,
x3 = p[3].x, y3 = p[3].y,
vxx, vxy, vyx, vyy,
vzx, vzy, x, y,
s, t, rs, rp;
x, y, s, t, rs, rp;

vxx = x2 - x1;
vxy = y2 - y1;
vyx = x1 - x0;
vyy = y1 - y0;
vzx = x3 - x0;
vzy = y3 - y0;
s = solve_linear_linear_system(vxx, vyx, -vzx, vxy, vyy, -vzy);
if (!s)
{
return false;
}
x = s[0].x; y = s[0].y;
s = solve_linear_linear_system(x2 - x1, x1 - x0, -(x3 - x0), y2 - y1, y1 - y0, -(y3 - y0));
if (!s) return false;
x = s[0].x;
y = s[0].y;
if (
(x > 1) ||
(4 * y > (x + 1) * (3 - x)) ||
Expand Down
2 changes: 1 addition & 1 deletion build/Geometrize.min.js

Large diffs are not rendered by default.

20 changes: 5 additions & 15 deletions src/CBezier.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,12 @@ var CBezier = makeClass(Bezier2D, {
x1 = p[1].x, y1 = p[1].y,
x2 = p[2].x, y2 = p[2].y,
x3 = p[3].x, y3 = p[3].y,
vxx, vxy, vyx, vyy,
vzx, vzy, x, y,
s, t, rs, rp;
x, y, s, t, rs, rp;

vxx = x2 - x1;
vxy = y2 - y1;
vyx = x1 - x0;
vyy = y1 - y0;
vzx = x3 - x0;
vzy = y3 - y0;
s = solve_linear_linear_system(vxx, vyx, -vzx, vxy, vyy, -vzy);
if (!s)
{
return false;
}
x = s[0].x; y = s[0].y;
s = solve_linear_linear_system(x2 - x1, x1 - x0, -(x3 - x0), y2 - y1, y1 - y0, -(y3 - y0));
if (!s) return false;
x = s[0].x;
y = s[0].y;
if (
(x > 1) ||
(4 * y > (x + 1) * (3 - x)) ||
Expand Down

0 comments on commit e928d85

Please sign in to comment.