@types/d3-polygon

  • Version 3.0.2
  • Published
  • 6.5 kB
  • No dependencies
  • MIT license

Install

npm i @types/d3-polygon
yarn add @types/d3-polygon
pnpm add @types/d3-polygon

Overview

TypeScript definitions for d3-polygon

Index

Functions

function polygonArea

polygonArea: (polygon: Array<[number, number]>) => number;
  • Returns the signed area of the specified polygon. If the vertices of the polygon are in counterclockwise order (assuming a coordinate system where the origin <0,0> is in the top-left corner), the returned area is positive; otherwise it is negative, or zero.

    Parameter polygon

    Array of coordinates <x0, y0>, <x1, y1> and so on.

function polygonCentroid

polygonCentroid: (polygon: Array<[number, number]>) => [number, number];
  • Returns the centroid of the specified polygon.

    Parameter polygon

    Array of coordinates <x0, y0>, <x1, y1> and so on.

function polygonContains

polygonContains: (
polygon: Array<[number, number]>,
point: [number, number]
) => boolean;
  • Returns true if and only if the specified point is inside the specified polygon.

    Parameter polygon

    Array of coordinates <x0, y0>, <x1, y1> and so on.

    Parameter point

    Coordinates of point <x, y>.

function polygonHull

polygonHull: (points: Array<[number, number]>) => Array<[number, number]> | null;
  • Returns the convex hull of the specified points using Andrew’s monotone chain algorithm. The returned hull is represented as an array containing a subset of the input points arranged in counterclockwise order. Returns null if points has fewer than three elements.

    Parameter points

    Array of coordinates <x0, y0>, <x1, y1> and so on.

function polygonLength

polygonLength: (polygon: Array<[number, number]>) => number;
  • Returns the length of the perimeter of the specified polygon.

    Parameter polygon

    Array of coordinates <x0, y0>, <x1, y1> and so on.

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (0)

No dev dependencies.

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/d3-polygon.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/d3-polygon)
  • HTML
    <a href="https://www.jsdocs.io/package/@types/d3-polygon"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>