src/NFtest/agentcell/cell/cell.cpp
//The diffusionConstant must be in units rads^2/s
The diffusionConstant must be in units rads^2/s
The diffusionConstant must be in units rads^2 / s
void AgentCell::changeDirRotDiffusion(double elapsedTime)
{
	lastDir[X]=dir[X]; lastDir[Y]=dir[Y]; lastDir[Z]=dir[Z];
	lastUp[X]=up[X]; lastUp[Y]=up[Y]; lastUp[Z]=up[Z];
	double rotDifTerm = sqrt(elapsedTime * 2. * rotDiffusionConstant);
	double angleX = rotDifTerm * NFutil::RANDOM_GAUSSIAN();
	double angleY = rotDifTerm * NFutil::RANDOM_GAUSSIAN();
	double angleZ = rotDifTerm * NFutil::RANDOM_GAUSSIAN();
	ChemotaxisUtil::genRotFromAngles(rotMat,angleX,angleY,angleZ);
	ChemotaxisUtil::applyRotation(rotMat,dir);
	ChemotaxisUtil::applyRotation(rotMat,up);
}
void AgentCell :: changeDirRotDiffusion ( double elapsedTime ) { lastDir [ X ] = dir [ X ] ; lastDir [ Y ] = dir [ Y ] ; lastDir [ Z ] = dir [ Z ] ; lastUp [ X ] = up [ X ] ; lastUp [ Y ] = up [ Y ] ; lastUp [ Z ] = up [ Z ] ; double rotDifTerm = sqrt ( elapsedTime * 2. * rotDiffusionConstant ) ; double angleX = rotDifTerm * NFutil :: RANDOM_GAUSSIAN ( ) ; double angleY = rotDifTerm * NFutil :: RANDOM_GAUSSIAN ( ) ; double angleZ = rotDifTerm * NFutil :: RANDOM_GAUSSIAN ( ) ; ChemotaxisUtil :: genRotFromAngles ( rotMat , angleX , angleY , angleZ ) ; ChemotaxisUtil :: applyRotation ( rotMat , dir ) ; ChemotaxisUtil :: applyRotation ( rotMat , up ) ; }
The diffusionConstant must be in units rads^2/s
The diffusionConstant must be in units rads^2 / s