## Physics math question

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

mcompany wrote:
TheKidPunisher wrote:So you only have to derivate the equation miojo give,

Vx= Ax t + Vx0
Vy= Ay t + Vy0

With your initial value and according your name of variable
Vx=a
Vy= g t +b

Also, saying "Vx=a" is like saying "the sky is a sky", and the following is true for "Vy=b". I just said that those were their literal definitions

As you accelaration in X is 0, your velocity in X is constant so you dont have to search an equation

mcompany
Autonomous Entity Posts: 872

### Re: Physics math question

Well I need an equation for solving for the velocity components, but yes, that is true

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

Why do you not accept:
A(Ax,Ay) --> A(0,g)
V(Vx,Vy) --> V(Vx0,gt +Vy0)
P(X,Y) --> P(Vx0*t+X0,(1/2)g(t²)+Vy0*t+Y0)

You have all with that: acceleration, velocity and position!

mcompany
Autonomous Entity Posts: 872

### Re: Physics math question

You still aren't understanding that I am specifically looking for vx0 and vy0, and the I already know P(x,y), A(0,g), and the total vector v0, and making an equation to solve for P(x,y) is nonsensical because I already know it

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

mcompany wrote:You still aren't understanding that I am specifically looking for vx0 and vy0, and the I already know P(x,y), A(0,g), and the total vector v0, and making an equation to solve for P(x,y) is nonsensical because I already know it

You are right, i think i really dont get what you want...
i really would like to help you as i like math but i think i have to give up, sry

mcompany
Autonomous Entity Posts: 872

### Re: Physics math question

mcompany wrote:solve for either a or b, given x, y, g, and v

mcompany wrote:I want the initial velocity components (or the initial velocity's angle, whichever is easier), given the initial velocity vector (v), given an acceleration in the y direction (gravity, or g) with no acceleration in the x direction, and given the the object passes through the point at (x,y).

mcompany wrote:
TheKidPunisher wrote:So why the equation miojo gave you are not good for you?

normally a simple parabola is solved when you get all the initial value...

Sure but then
Vx=(x)/T
Vy=(y-0.5*(g*(t^2))/T

What is "T" and what is "t"?

mcompany wrote:You still aren't understanding that I am specifically looking for vx0 and vy0, and the I already know P(x,y), A(0,g), and the total vector v0, and making an equation to solve for P(x,y) is nonsensical because I already know it

Um... ok

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

So you already have the parabola and you want the initial parameter vector?

Or you want to choose initial parameter to have a specific parabola?

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

oh i think i got it (finally^^ i really have some problem when the text of the problem is in english...)!

Do you confirm that you have this informations:
P0(X0,Y0) initial position of the projectile
P1(X1,Y1) a (random) point of your parabola
The value of the vector velocity initial V0 but not his component (Vx0,Vy0)
And i understand that if all time the acceleration is A(0,g)

And finally you search the value of component of the velocity (or atleast the angle of the vector)

If it is ok, i got a solution for you. but i'm tired i will write it, after sleep if you agree all of the previous points.

mcompany
Autonomous Entity Posts: 872

### Re: Physics math question

Yes

Miojo
Script Posts: 37

### Re: Physics math question

T=t. I wrote that on mobile

mcompany
Autonomous Entity Posts: 872

### Re: Physics math question

Ok

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

sry i just wake up.

We suppose an angle w, the angle between the X direction and the direction of the vector V0

So we got Vx0=V0*cos(w) and Vy0=V0*sin(w)

We calculate the differance of position between the point P(X,Y) at instant t on the parabola and the initial point P0(X0,Y0) at instant t0

We obtain: X-X0=Vx0*t+X0-Vx0*t0-X0 but t0=0 so (X-X0)/(Vx0)=t [equation 1]

We calculate the same for Y-Y0

Y-Y0=(1/2)*g*t²+Vy0*t+Y0-(1/2)*g*t0²-Vy0*t0-Y0 but t0=0

so Y=(1/2)*g*t²+Vy0*t+Y0

You replace t by his value in the [equation 1] and after some simplification you got:

Y=(1/2)*g*(X-X0)²/(Vx0)²+Vy0*(X-X0)/(Vx0)+Y0

If you consider the origin at P0(X0=0,Y0=0) it will simplify the calculation after(if not use the same technique as below but with a bigger equation):

Y=(1/2)*g*(X)²/(Vx0)²+Vy0*(X)/(Vx0)
And with the power of trigo:
1/(Vx0)²=1/(V0*cos(w))²=(1+[tan(w)]²)/V0²
and Vy0/Vx0=V0*sin(w)/V0*cos(w)=tan(w)

we replace them in the equation:
Y=(1/2)*g*(X)²(1+[tan(w)]²)/V0²+X*tan(w)

Then you use the by point P1 the parabola pass by:
Y1=(1/2)*g*(X1)²(1+[tan(w)]²)/V0²+X1*tan(w)

And i let you do the rest, it is now a polynome and 2 degre (solve it conserdiring tan(w)=T so you have to solveY1=(1/2)*g*(X1)²(1+T²)/V0²+X1*T

Then when it solve use the value S you find and do w=arctan(S)

Caution: you will have these case:
-if P1 is out of range: polynome insolvable
-if P1 is at max range : 1 solution (noramlly it will be w=45°)
-if P1 is between max range and initial position so 2 solutions (one with w>45° and other with w<45°)

Hope it is what you want, if you prefer Vx0 and Vy0 value just do the calculation with the value of w in the first equation:Vx0=V0*cos(w) and Vy0=V0*sin(w)

Tell me if you have questions.

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

So it was what you needed?

pier4r
Skynet Posts: 3390

### Re: Physics math question

Quite a work Kid. I did not went through your idea so far. I'd like to give it a go by myself first .
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

Oh so it was you
mcompany wrote:So, one of my friends …

Do as you want but feel free to use my idea or ask me some questions about it.

pier4r
Skynet Posts: 3390

### Re: Physics math question

No, mcompany posted the same on telegram and I was attacking the problem but then I had to go.

You could see the conversation if you scroll back enough in telegram.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

i didnt go on telegram since a long time, maybe i will be back when i will play seriously

TheKidPunisher
Autonomous Entity Posts: 565

### Re: Physics math question

I didnt ask: what type of game is he making?

A «Worms» like game?