Created
February 16, 2016 04:13
-
-
Save SIRHAMY/4fef81b52f43cb277a6d to your computer and use it in GitHub Desktop.
Euler Midpoint Step Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Simulator::midpointStep(Eigen::Vector3d particle) { | |
Eigen::Vector3d halfTimeStepChangeV = { 0, (mTimeStep * 0.5) * -9.8, 0 }; | |
particle.mVelocity[1] += halfTimeStepChangeV[1]; | |
particle.mPosition[1] += (mTimeStep * particle.mVelocity[1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment