{"_id":"ray-sphere-intersection","_rev":"3-bdcbb514baf93bd59da453eb5c8bae56","name":"ray-sphere-intersection","description":"test whether a ray intersects with a sphere","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"ray-sphere-intersection","version":"1.0.0","description":"test whether a ray intersects with a sphere","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"gl-vec3":"^1.0.3"},"devDependencies":{"tape":"^4.0.0"},"scripts":{"test":"node test.js"},"keywords":["sphere","intersect","ray","origin","direction","test","hit","pick","ray","picking","camera","project","unproject","collision","intersections"],"repository":{"type":"git","url":"git://github.com/mattdesl/ray-sphere-intersection.git"},"homepage":"https://github.com/mattdesl/ray-sphere-intersection","bugs":{"url":"https://github.com/mattdesl/ray-sphere-intersection/issues"},"gitHead":"f3d5ff5928f57adb3a512b37bbdedb6e2e47fff5","_id":"ray-sphere-intersection@1.0.0","_shasum":"7f233d1d4dbaf5265757c9826532f53b1e4eeaca","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"7f233d1d4dbaf5265757c9826532f53b1e4eeaca","tarball":"https://registry.npmjs.org/ray-sphere-intersection/-/ray-sphere-intersection-1.0.0.tgz","integrity":"sha512-rjoi1dz5hIThzJGPzcU64YqwVsWDh9nqhSgka2UfXP/WirJLWXbNcVW91Jy0GfJZNaZknxkC/ipIm5wBSxwccA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfC8Cvj9hVX+u0mk1mbnOjePaxXODxIosS8AnMXzqpiAIgUtEPqShOarzndIWJLRfKPUgyZxDIe3zmFIrL3qwS5zI="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}]}},"readme":"# ray-sphere-intersection\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nTest whether a ray intersects with a sphere.\n\n```js\nvar intersect = require('ray-sphere-intersection')\n\nvar origin = [0, 0, 4], \n    direction = [0, 0, -1], \n    center = [0, 0, 0], \n    radius = 1\n\nvar hit = intersect([], origin, direction, center, radius)\n\nif (hit) {\n  console.log(hit) // [0, 0, 1]\n}\n```\n\nAdapted from [LibGDX](https://github.com/libgdx/libgdx/blob/9eba80c6694160c743e43d4c3a5d60a5bad06f30/gdx/src/com/badlogic/gdx/math/Intersector.java). PRs for optimizations/etc welcome.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/ray-sphere-intersection.png)](https://www.npmjs.com/package/ray-sphere-intersection)\n\n#### `out = intersect(out, origin, direction, center, radius)`\n\nDetermines if the 3D ray `(origin, direction)` intersects with the 3D sphere `(center, radius)`. \n\nIf no intersection occurs, returns `null`. Otherwise, the intersection point is stored in `out` and then returned.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/ray-sphere-intersection/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2022-06-25T13:47:00.519Z","created":"2015-05-15T13:44:28.833Z","1.0.0":"2015-05-15T13:44:28.833Z"},"homepage":"https://github.com/mattdesl/ray-sphere-intersection","keywords":["sphere","intersect","ray","origin","direction","test","hit","pick","ray","picking","camera","project","unproject","collision","intersections"],"repository":{"type":"git","url":"git://github.com/mattdesl/ray-sphere-intersection.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"bugs":{"url":"https://github.com/mattdesl/ray-sphere-intersection/issues"},"license":"MIT","readmeFilename":"README.md"}