Giter VIP home page Giter VIP logo

point2point's Introduction

point2point

This is a work in progress do not use it in any kind of production.

This is a minimal 2D vector calculation library that I wrote for my horse race track maker and parser as part of my horse racing game side project. Detail Documenation will follow in the near future.

The Overall wrapping class is PointCal.

To install and try this out

npm install point2point

import the PointCal class

import { PointCal } from "point2point";

The calculations that this library is capable of is listed below.

  • Vector Addition
PointCal.addVector({x: 0, y: 1}, {x: 1, y: 2})
// this would return a {x: number, y: number} object
// which in this case would be {x: 1, y: 3}
  • Vector Subtraction
PointCal.subVector({x: 0, y: 1}, {x: 1, y: 2})
// this would return a {x: number, y: number} object
// which in this case would be {x: -1, y: -1}
  • Multiply A Vector With a Scalar Value
  • Unit Vector of a Vector
  • Unit Vector from Point A to Point B
  • Magnitude of a Vector
  • Distance between 2 Points
  • Rotate a Vector $\theta$ radians (CCW is the positive direction)
  • Dot Product
  • Cross Product
  • Angle from Vector A to Vector B

point2point's People

Contributors

niuee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.