More math
This commit is contained in:
@@ -38,4 +38,8 @@ export function scale(a: Vec3, s: number) : Vec3 {
|
||||
a[1] * s,
|
||||
a[2] * s,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export function normalize(a: Vec3) : Vec3 {
|
||||
return scale(a, 1/norm(a));
|
||||
}
|
||||
|
Reference in New Issue
Block a user