I need to write a function in C ++ that can model and try the trajectory of the trajectory of an object moving through three-dimensional space.
Problem Statement:
The function must accept 3 arguments as input. A function prototype might look something like this:
void CalculateAndSampleTrajectory(Vec3 direction, float impulse, float mass)
{
}
Vec3 direction is structure. These are essentially 3 floats that behave as a unit vector describing the initial angle of the pulse.
Momentum float is a measure of how powerful the impulse is.
A floating point array describes the mass of the projected object.
3 , , , .
, ( 200) 4 . Vec3s .
SI, - 9.81. .
:
, . , , .
, , , , :
Vec3 velocity = (direction * impulse)/mass;
, , , f = ma, a, . , , , , .
, , , ,
++.
, , 200 4 . :
for(int i = 0; i < 200; i++)
{
int t = 0;
t = t + 0.02;
}
t 3 (x, y, z), Vec3.
:
, , , . ++.
, .