1.0.1 • Published 6 years ago

pick-point-in-triangle v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

pick-point-in-triangle

experimental

Pick a random point in a triangle, derived from this reference.

Usage

NPM

var bunny   = require('bunny')
var cells   = bunny.cells
var positions = bunny.positions
var triangle = [positions[cells[0][0]], positions[cells[0][1]], positions[cells[0][2]]]
var point = require('pick-point-in-triangle')(triangle);

require("pick-point-in-triangle")(vertices)

Uniformly samples within a triangle given an array of 3 vertices.

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.