Package Exports
- circumcircle
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (circumcircle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
circumcircle
Fast algorithm to calculate the circumcircle of a 2D triangle.
Install
npm install circumcircleExample
const circumcircle = require('circumcircle');
const points = [ [0.0, -0.5], [0.5, 0.5], [-0.5, 0.5] ];
console.log(circumcircle(points));Output:
{ x: 0, y: 0.125, r: 0.625 }Demo
Usage
circumcircle(points, radiusSq = false)
pointsan array with 3 points[ [x,y], [x,y], [x,y] ]radiusSqreturns 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.
