circumcircle
Fast algorithm to calculate the circumcircle of a 2D triangle.
Install
npm install circumcircle
Example
const circumcircle = ; const points = 00 -05 05 05 -05 05 ;console;
Output:
x: 0 y: 0125 r: 0625
Demo
Usage
circumcircle(points, radiusSq = false)
-
points
an array with 3 points[ [x,y], [x,y], [x,y] ]
-
radiusSq
returns the radius squared - faster because it skipsMath.sqrt()
Returns an object with circumcenter and circumradius { x, y, r }
Credits
Lingjia Liu and Joseph O'Rourke
See Also
License
MIT, see LICENSE for details.