@pqmcgill/point

0.0.161 • Public • Published

@vx/point

npm install --save @vx/point

A simple class to represent an x, y coordinate.

Example Usage

import { Point } from '@vx/point';

let point  = new Point({ x: 2, y: 3 });
let {x, y} = point.value()   // Get the cords from the point
let array  = point.toArray() // Convert point to array

Methods

point.value()

Returns an {x, y} object with the x and y coordinates.

point.toArray()

Returns the coordinates as an array [x, y].

Package Sidebar

Install

npm i @pqmcgill/point

Weekly Downloads

4

Version

0.0.161

License

MIT

Unpacked Size

3.18 kB

Total Files

4

Last publish

Collaborators

  • pqmcgill