Skip to content

QuentinRoy/polygon-centroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codecov dependencies Status devDependencies Status npm version

@quentinroy/polygon-centroid

Calculate the centroid of any non-self-intersecting closed polygon.

Install

npm install @quentinroy/polygon-centroid

Example

const polygonCentroid = require("@quentinroy/polygon-centroid");
const centroid = polygonCentroid([
  { x: 0, y: 0 },
  { x: 0, y: 1 },
  { x: 1, y: 1 },
]);

About

Calculate the centroid of any non-self-intersecting closed polygon.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published