mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-09-01 02:41:45 +02:00
Added vsqr(), vnf_centroid(), and vnf_volume()
This commit is contained in:
@@ -95,6 +95,14 @@ function vdiv(v1, v2) = [for (i = [0:1:len(v1)-1]) v1[i]/v2[i]];
|
||||
function vabs(v) = [for (x=v) abs(x)];
|
||||
|
||||
|
||||
// Function: vsqr()
|
||||
// Usage:
|
||||
// x = vsqr(v);
|
||||
// Description:
|
||||
// Returns a vector where each value in the original given vector is squared.
|
||||
function vsqr(v) = [for(i=v) i*i];
|
||||
|
||||
|
||||
// Function: unit()
|
||||
// Description:
|
||||
// Returns unit length normalized version of vector v.
|
||||
|
Reference in New Issue
Block a user