bound-points

WebJar for bound-points

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

bound-points
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

bound-points
WebJar for bound-points
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/bound-points

Download bound-points

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/bound-points/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>bound-points</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/bound-points/
implementation 'org.webjars.npm:bound-points:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/bound-points/
implementation ("org.webjars.npm:bound-points:1.0.0")
'org.webjars.npm:bound-points:jar:1.0.0'
<dependency org="org.webjars.npm" name="bound-points" rev="1.0.0">
  <artifact name="bound-points" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='bound-points', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "bound-points" % "1.0.0"
[org.webjars.npm/bound-points "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

bound-points

Computes a bounding box from a set of points in any dimension.

Example

var getBounds = require('bound-points')

var points = [[-1, 1], [5, 10], [-8, 13]]
console.log('2d:', getBounds(points))

var mesh = require('bunny')
console.log('3d:', getBounds(mesh.positions))

Output:

2d: [ [ -8, 1 ], [ 5, 13 ] ]
3d: [ [ -4.958475, -0.003149, -3.729833 ],
  [ 4.94885, 9.654748, 3.810639 ] ]

Install

npm i bound-points

API

var bounds = require('bound-points')(points)

Computes an axis aligned bounding box for a set of points.

  • points is an array of points

Returns A pair of lower and upper bounds for the point set.

For example:

[ [ minX, minY ], [ maxX, maxY ] ]

License

(c) 2015 Mikola Lysenko. MIT License

Versions

Version
1.0.0