Sign in to follow this  

problems solving for time

This topic is 3483 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to write a function that takes a velocity and an acceleration and will return how much time it takes to travel x distance. First i wrote it with only velocity and it was simple: D = Vt+ 1/2At² D = Vt //acceleration is 0 D/V = t TargetImpactTimer = Distance/Velocity;
float TimeTaken(Distance,Velocity,Acceleration)
{
return Distance/Velocity;
}

then i wrote it zeroing out the velocity D = Vt+ 1/2At² D = 1/2At² //Velocity is zero 2D = At² 2D/A = t² sqrt(2D/a) = t TargetImpactTimer = sqrt(2*Distance/AccelerationLength);

float TimeTaken(Distance,Velocity,Acceleration)
{
return sqrt(2*Distance/AccelerationLength);
}

and this works fine too. But I cant seem to combine the two to make a function that would use them both.

Share this post


Link to post
Share on other sites

This topic is 3483 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this