tiny-point

JS utility to manage a point in a two-dimensional system

Usage no npm install needed!

<script type="module">
  import tinyPoint from 'https://cdn.skypack.dev/tiny-point';
</script>

README

Core Graphics - Point

Simple JavaScript utility to create and manipulate a point on screen (x, y)

Point represents a x and y co-ordinate on screen.

The problem

  1. You want to find a point from a touch or mouse click event
  2. You want to measure the distance between two points
  3. You want to find the closest point to another point
  4. You want to rotate multiple points (line) around an origin
  5. You want to find the center of two points
  6. You want to get the value of a point relative to an element

Installation

yarn add tiny-point
# or
npm i tiny-point

Inspiration

Most of the code was inspired by SwiftUI, .NET and Dart's approach to creating geometric primitives that made it easier to manage UI interactions.

Contribution

Yes please! See the contributing guidelines for details.

Licence

This project is licensed under the terms of the MIT license.