Socket
Book a DemoInstallSign in
Socket

poly-line

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poly-line

Generate paths and cycles

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

poly-line

Generates a polygonal line or curve from a sequence of vertices.

Install

npm install poly-line

Example

var polyLine = require("poly-line")

//Generate a path
console.log(polyLine([0,1,2,3]))

//Prints:
//
//    [[0,1], [1,2], [2,3]]
//

//Generate a cycle:
console.log(polyLine([0,1,2,3], true))

//Prints:
//
//    [[0,1], [1,2], [2,3], [3,0]]
//

require("poly-line")(vertices[, closed])

Creates a polygonal line/cycle.

  • vertices is the set of vertices to generate
  • closed if set to true, then closes the polygonal curve

Returns: A list of cells representing the polygonal line

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

path

FAQs

Package last updated on 04 Apr 2013

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