study_assets_root/rdk/jspsych-5.0.3/plugins/jspsych-RDK.js
//Creates a new angle to move towards and updates the x and y coordinates
Creates a new angle to move towards and updates the x and y coordinates
Creates a new angle to move towards and updates the x and y coordinates
function randomWalkUpdate(dot) {
			var theta = randomNumberBetween(-Math.PI, Math.PI);
			dot.latestXMove = Math.cos(theta) * moveDistance;
			dot.latestYMove = -Math.sin(theta) * moveDistance;
			dot.x += dot.latestXMove;
			dot.y += dot.latestYMove;
			return dot;
		}
function randomWalkUpdate ( dot ) { var theta = randomNumberBetween ( - Math . PI , Math . PI ) ; dot . latestXMove = Math . cos ( theta ) * moveDistance ; dot . latestYMove = - Math . sin ( theta ) * moveDistance ; dot . x += dot . latestXMove ; dot . y += dot . latestYMove ; return dot ; }
Creates a new angle to move towards and updates the x and y coordinates
Creates a new angle to move towards and updates the x and y coordinates
//Generate a random angle of movement //Generate the movement from the angle //Update x and y coordinates with the new location