GetDistanceBetwTwoArrays

From scripting
Jump to: navigation, search
global proc float GetDistanceBetwTwoArrays(float $A1[], float $A2[]) {
	//Author Nick Pisca 0001d 2010
	//float $A1[] = {0,22,1}; float $A2[] = {22,0,0};
	vector $A1vec = <<$A1[0],$A1[1],$A1[2]>>;
	vector $A2vec = <<$A2[0],$A2[1],$A2[2]>>;
	vector $DDiff = $A1vec-$A2vec;
	float $FF=mag($DDiff);
	return $FF;
}


Related Functions: GetDistanceBetwTwoVectors ReturnNVectorCOG

More information on vectors and vector mathematics, read pages 14-16, 20-21 in YSYT.