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

polygon-centroid

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

polygon-centroid

Return the centroid for a given convex polygon.

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
5.7K
-17.93%
Maintainers
1
Weekly downloads
 
Created
Source

polygon-centroid

Return the centroid for a given convex polygon.

Installation

npm i polygon-centroid --save

Usage

centroid(points) Return the point {x, y} which is the centroid of the given set of points (convex polygon).

Example

var centroid = require('polygon-centroid');
var center = centroid(this.polygon.points);
this.polygon.anchor.set(center.x, center.y);
this.polygon.rotation = Math.PI * 0.5;

Keywords

polygon

FAQs

Package last updated on 22 May 2018

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