New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

centroid2d

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

centroid2d

A package to find the area weighted center of a convex polygon whose mass is evenly distributed across the surface.

latest
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

Centroid 2D

A package to find the area weighted center of a convex polygon whose mass is evenly distributed across the surface.

Usage

$ npm i centroid2d
const findCentroid = require('centroid2d)

let polygon = [
    [0, 0],
    [5, 0],
    [5, 5],
    [0, 5],
]
let centroid = findCentroid(polygon) // [2.5, 2.5]

Input must be an array of arrays of x and y coordinates.

There is no typechecking for simplicity and speed.

TODO:

Feedback ✉️

It is greatly appreciated! 🎉

Website 🌐

js@jacobsmith.tech

https://github.com/limeandcoconut

@limeandcoconut 🐦

Cheers!

License

ISC, see license for details.

Keywords

centroid

FAQs

Package last updated on 04 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts