2.0.1 • Published 10 years ago

ray-vs-rect v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

ray-vs-rect

Ray-aware rectangle intersection check.

Usage

var rayVsRect = require('ray-vs-rect');

var ray = {
  start: {x: 10, y: 50},
  end: {x: 70, y: 50}
};

var rect = {
  left: 45,
  top: 45,
  width: 10,
  height: 10
};

var point = rayVsRect(ray, rect);

point // {x: 45, y: 50}

Install

npm install ray-vs-rect

License

MIT