Yes. As the ball is moving. Relevant log:
number of degrees is 135, theta is 2.35619449019234, velocity x is 1.75438594818115, velocity y is 0, and velocity z is -9.8100004196167.
Ball is now at 0.035087719559669, 0, 499.803802490234.
number of degrees is 135, theta is 2.35619449019234, velocity x is 1.75438594818115, velocity y is 0, and velocity z is -9.8100004196167.
Ball is now at 0.070175439119339, 0, 499.607604980469.
number of degrees is 135, theta is 2.35619449019234, velocity x is 1.75438594818115, velocity y is 0, and velocity z is -9.8100004196167.
Ball is now at 0.105263158679008, 0, 499.411407470703.
Now, if I change deg to something different, the degrees and theta all calculate correctly, but still no y incrementation. Relevant log:
number of degrees is 253, theta is 4.41568300754565, velocity x is 1.75438594818115, velocity y is 0, and velocity z is -9.8100004196167.
Ball is now at 0.035087719559669, 0, 499.803802490234.
number of degrees is 253, theta is 4.41568300754565, velocity x is 1.75438594818115, velocity y is 0, and velocity z is -9.8100004196167.
Ball is now at 0.070175439119339, 0, 499.607604980469.
As you can see, the degrees and theta calculate correctly. However, the ball doesn't actually travel in the direction specified by degrees. It travels along x and z only, no matter what degree value I choose.
I'll paste the math stuff here to see if maybe you can find the issue:
double DT;
double theta;
double deg = 253;
double ModR = 0.08728;
float M2 = 0.057;
float x, y, z;
float d;
float roh = 1.151;
float A = 0.0033;
float CD = 0.507;
float FL;
float DX = (CD*roh*A)*power((vel.x/2),2);
float DY = (CD*roh*A)*power((vel.y/2),2);
float DZ = (CD*roh*A)*power((vel.z/2),2);
const double pi = 3.14159265358979;
vector NetF = lift+drag+grav;
vector acc(0.1, 0.1, 0);
vector vel((acc.x/M2)*cosine(theta), (acc.y/M2)*sine(theta), grav.z);
vector drag(DX, DY, DZ);
vector grav(0, 0, -9.81);
vector lift(2, 5, 0);
double RTD(double theta)
{
return deg = theta*180/pi;
}
double DTR(double deg)
{
return theta = deg*pi/180;
}
vector power(vector v, double exponent)
{
vector ret (power(v.x, exponent), power(v.y, exponent), power(v.z, exponent));
return ret;
}
float GetDistance(vector v1, vector v2)
{
vector v;
v.x = v1.x - v2.x;
v.y = v1.y - v2.y;
v.z = v1.z - v2.z;
return d = square_root(power(v.x,2)+power(v.y,2)+power(v.z,2));
}
double init()
{
DT = 0.001*C.delay;
return DT;
}