Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

2d-bounds

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

2d-bounds

barebones array based 2d bounds compute

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

2d-bounds

barebones array based 2d bounds compute

install

npm install 2d-bounds

use

bounds2(points [, out])

  • points - array of 2+ item arrays (i.e. [[0, 0], [1, 1]]) representing an array of 2d vectors
  • out - avoid creating garbage by reusing an array

returns out which is a 4 component array: [lowX, lowY, hiX, hiY]

example

var bounds2 = require('2d-bounds');

var polyline = [
  [-100, 100],
  [0, 0],
  [10, 200]
];

var b = bounds2(polyline);

console.log(b);
// outputs: [ -100, 0, 10, 200 ]

license

MIT

Keywords

FAQs

Package last updated on 19 Apr 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc