I need help calculating the (x,y) position at each time step I was provided with in the .txt file. As well as displaying it on the screen, these are the equations I have to work with. https://imgur.com/a/sm2ywwU
Should I put them inside the while loop?
Yeah of course.. There are quite a few values but here are the first 5 and last 5.
0.0000000e+00 1.6418175e+01 1.6915159e+01
1.0000000e-01 1.6418175e+01 1.6915159e+01
2.0000000e-01 1.6416387e+01 1.6916946e+01
3.0000000e-01 1.6412289e+01 1.6917663e+01
4.0000000e-01 1.6407815e+01 1.6921339e+01
.
.
.
8.6000000e+00 1.6381349e+01 1.6945634e+01
8.7000000e+00 1.6381036e+01 1.6946175e+01
8.8000000e+00 1.6393067e+01 1.6946085e+01
8.9000000e+00 1.6388345e+01 1.6949406e+01
9.0000000e+00 1.6391376e+01 1.6948039e+01
Also this was the second page we were given and where the question was asked. It would probably be useful since it has the values for L and D... Lol https://imgur.com/a/NSQ1wrr
But honestly I'm just stuck on where the equation would go... I feel like I could figure out the "math" part for the equation itself but I'm lost when it comes to calculating in loops for each value step.
...
float pos_x = 0.f, pos_y = 0.f;
for (int i = 0; i < (int)t.size(); ++i)
{
tmp_pos_x = // Here comes
tmp_pos_y = // the code of the formula.
pos_x += tmp_pos_x, pos_y += tmp_pos_y;
cout << "After "<< t[i] << " seconds, the robot is at position ("<<pox_x<<","<<pos_y<<").\n";
}