Difference between pages "ReturnNVectorCOG" and "ReturnRandomVector"

From scripting
(Difference between pages)
Jump to: navigation, search
(Created page with " global proc vector ReturnNVectorCOG(vector $AllVecs[]) { //Author Nick Pisca 0001d 2010 //$AllVecs[0]=<<0,0,0>>;$AllVecs[1]=<<1,-1,0>>;$AllVecs[2]=<<1,0,0>>;$AllVecs[3]=<...")
 
(Created page with " global proc vector returnRandomVector(float $Lower, float $Higher) { //Author Nick Pisca 0001d 2009 float $XVal = rand($Lower, $Higher); float $YVal = rand($Lower, $Higher...")
 
Line 1: Line 1:
  global proc vector ReturnNVectorCOG(vector $AllVecs[]) {
+
  global proc vector returnRandomVector(float $Lower, float $Higher) {
//Author Nick Pisca 0001d 2010
+
//Author Nick Pisca 0001d 2009
//$AllVecs[0]=<<0,0,0>>;$AllVecs[1]=<<1,-1,0>>;$AllVecs[2]=<<1,0,0>>;$AllVecs[3]=<<0,0,2>>;
+
float $XVal = rand($Lower, $Higher);
vector $TempVec = <<0,0,0>>;
+
float $YVal = rand($Lower, $Higher);
if (size($AllVecs) != 0 ) {
+
float $ZVal = rand($Lower, $Higher);
for ($i=0;$i<size($AllVecs);$i++) {
+
vector $CAPVec = <<$XVal, $YVal, $ZVal>>;
$TempVec = $TempVec + $AllVecs[$i];
+
return $CAPVec;
}
 
$TempVec = $TempVec / size($AllVecs);  
 
}
 
return $TempVec;
 
 
  }
 
  }
  
  
 
+
''More information on vectors and vector mathematics, read pages 14-16, 20-21 in [http://stores.lulu.com/nickpisca YSYT].  
 
 
''More information on vectors and vector mathematics, read pages 14-16, 20-21 in [http://stores.lulu.com/nickpisca YSYT].
 
 
[[Category:MEL]]
 
[[Category:MEL]]

Latest revision as of 19:56, 24 April 2017

global proc vector returnRandomVector(float $Lower, float $Higher) {
//Author Nick Pisca 0001d 2009
float $XVal = rand($Lower, $Higher);
float $YVal = rand($Lower, $Higher);
float $ZVal = rand($Lower, $Higher);
vector $CAPVec = <<$XVal, $YVal, $ZVal>>;
return $CAPVec;
}


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