Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quentinroy/polygon-centroid
Calculate the centroid of any non-self-intersecting closed polygon.
https://github.com/quentinroy/polygon-centroid
centroid polygon
Last synced: 5 days ago
JSON representation
Calculate the centroid of any non-self-intersecting closed polygon.
- Host: GitHub
- URL: https://github.com/quentinroy/polygon-centroid
- Owner: QuentinRoy
- License: other
- Created: 2018-01-29T11:08:25.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-09T22:57:40.000Z (5 months ago)
- Last Synced: 2024-11-07T06:11:43.470Z (8 days ago)
- Topics: centroid, polygon
- Language: JavaScript
- Homepage:
- Size: 195 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/QuentinRoy/polygon-centroid.svg?branch=master)](https://travis-ci.org/QuentinRoy/polygon-centroid)
[![codecov](https://codecov.io/gh/QuentinRoy/polygon-centroid/branch/master/graph/badge.svg)](https://codecov.io/gh/QuentinRoy/polygon-centroid)
[![dependencies Status](https://david-dm.org/quentinroy/polygon-centroid/status.svg)](https://david-dm.org/quentinroy/polygon-centroid)
[![devDependencies Status](https://david-dm.org/quentinroy/polygon-centroid/dev-status.svg)](https://david-dm.org/quentinroy/polygon-centroid?type=dev)
[![npm version](https://img.shields.io/npm/v/@quentinroy/polygon-centroid.svg)](https://www.npmjs.com/package/@quentinroy/polygon-centroid)# @quentinroy/polygon-centroid
Calculate the centroid of any non-self-intersecting closed polygon.
## Install
`npm install @quentinroy/polygon-centroid`
## Example
```js
const polygonCentroid = require("@quentinroy/polygon-centroid");
const centroid = polygonCentroid([
{ x: 0, y: 0 },
{ x: 0, y: 1 },
{ x: 1, y: 1 },
]);
```