point npm bundle size (scoped) npm

The point library contains a collection of functions for dealing with points with numerical x and y values.

Installation

npm install --save @danehansen/point

Usage

As a module:

import * as point from '@danehansen/point';

var p1 = {x: 50, y: 75};
var p2 = point.add(p1, {x: 5, y: 5});
var d = point.distance(p1, p2);

In your browser:

<script src='danehansen-point.min.js'></script>
<script>
  var point = window.danehansen.point;
  var p1 = {x: 50, y: 75};
  var p2 = point.add(p1, {x: 5, y: 5});
  var d = point.distance(p1, p2);
</script>

Methods