Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double x = (perpAB()*midAB().getX()-midAB().getY()-perpBC()*midBC().getX()+midBC().getY())/(perpAB()-perpBC());
- double y = perpAB()*x-perpAB()*midAB().getX()+midAB().getY();
- if(Double.isNaN(x)==true)
- {
- x = (perpAB()*midAB().getX()-midAB().getY()-perpAC()*midAC().getX()+midAC().getY())/(perpAB()-perpAC());
- y = perpAB()*x-perpAB()*midAB().getX()+midAB().getY();
- }
- if(Double.isNaN(x)==true)
- {
- x = (perpBC()*midBC().getX()-midBC().getY()-perpAC()*midAC().getX()+midAC().getY())/(perpBC()-perpAC());
- y = perpBC()*x-perpBC()*midBC().getX()+midBC().getY();
- }
- Point circumcenter = new Point(x,y);
- return circumcenter;
Add Comment
Please, Sign In to add comment