mirror of
https://github.com/xibyte/jsketcher
synced 2026-02-15 20:03:06 +01:00
fix errors
This commit is contained in:
parent
64e9e52b11
commit
7fd42f94bc
2 changed files with 6 additions and 7 deletions
|
|
@ -55,12 +55,11 @@ public class Parallel implements Constraint {
|
|||
|
||||
@Override
|
||||
public double error() {
|
||||
double dx1 = (params[l1p1x].get() - params[l1p2x].get());
|
||||
double dy1 = (params[l1p1y].get() - params[l1p2y].get());
|
||||
double dx2 = -(params[l2p1x].get() - params[l2p2x].get());
|
||||
double dy2 = (params[l2p1y].get() - params[l2p2y].get());
|
||||
//dot product shows how the lines off to be perpendicular
|
||||
return (dx1 * dy2 - dy1 * dx2);
|
||||
double dx1 = (params[l1p1x].get() - params[l1p2x].get());
|
||||
double dy1 = (params[l1p1y].get() - params[l1p2y].get());
|
||||
double dx2 = (params[l2p1x].get() - params[l2p2x].get());
|
||||
double dy2 = (params[l2p1y].get() - params[l2p2y].get());
|
||||
return (dx1*dy2 - dy1*dx2);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class Perpendicular implements Constraint {
|
|||
double dx2 = (params[l2p1x].get() - params[l2p2x].get());
|
||||
double dy2 = (params[l2p1y].get() - params[l2p2y].get());
|
||||
//dot product shows how the lines off to be perpendicular
|
||||
return (dx1 * dx2 + dy1 * dy2);
|
||||
return (dx1*dx2 + dy1*dy2);
|
||||
}
|
||||
|
||||
//derivative of ((x-a1)*a2 + a3)^2
|
||||
|
|
|
|||
Loading…
Reference in a new issue