[vtkusers] BrownianPoints

h.huisman at rad.umcn.nl h.huisman at rad.umcn.nl
Tue Jun 4 06:57:35 EDT 2002


Hi,

Tried to use vtkBrownianPoints. Saw only positve displacements, which is 
odd considering Brownian motion should occur in all directions. Source 
code says:

    speed = vtkMath::Random(this->MinimumSpeed,this->MaximumSpeed);
    if ( speed != 0.0 )
      {
      for (j=0; j<3; j++)
        {
        v[j] = vtkMath::Random(0,speed);
	}
      norm = vtkMath::Norm(v);
      for (j=0; j<3; j++)
        {
        v[j] *= (speed / norm);
        }
      }

I think the vtkMath line should read:

	v[j] = speed*vtkMath::Random(-1,1);

which assigns a vector of complete random orientation to v, instead of the 
positive half space only.

Henkjan

---------------------------------------------------------------------
H.J. Huisman, PhD, MSEE       E : h.huisman at rad.umcn.nl
Biomedical Physicist          T : +31 24 3617536/14545
Dept. Radiology               F : +31 24 3540866
UMC St. Radboud               S : 430 Radiologie/POBox 9101/
                                  6500HB Nijmegen/Netherlands






More information about the vtkusers mailing list