Added a squared vector function for A^2 + B^2 without the rooting, in case massively large nos of vector calculations are needed.
This was SVN commit r10528.
This commit is contained in:
parent
3a678a0c7c
commit
97d3f1cfc9
@ -5,6 +5,13 @@ function VectorDistance(a, b)
|
||||
return Math.sqrt(dx*dx + dz*dz);
|
||||
}
|
||||
|
||||
function SquareVectorDistance(a, b)//A sqrtless vector calculator, to see if that improves speed at all.
|
||||
{
|
||||
var dx = a[0] - b[0];
|
||||
var dz = a[1] - b[1];
|
||||
return (dx*dx + dz*dz);
|
||||
}
|
||||
|
||||
function MemoizeInit(obj)
|
||||
{
|
||||
obj._memoizeCache = {};
|
||||
|
Loading…
Reference in New Issue
Block a user