Updates getPointsBetween
This commit is contained in:
parent
062dbafc36
commit
cbc26f2e06
3 changed files with 43 additions and 10 deletions
|
@ -5,6 +5,15 @@ import vec from 'utils/vec'
|
|||
* ## Utils
|
||||
*/
|
||||
export default class Utils {
|
||||
static getPointsBetween(a: number[], b: number[], steps = 6): number[][] {
|
||||
return Array.from(Array(steps))
|
||||
.map((_, i) => {
|
||||
const t = i / steps
|
||||
return t * t * t
|
||||
})
|
||||
.map((t) => [...vec.lrp(a, b, t), (1 - t) / 2])
|
||||
}
|
||||
|
||||
static getRayRayIntersection(
|
||||
p0: number[],
|
||||
n0: number[],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue