Page **1** of **2**

### Physics math question

Posted: **22 Jul 2017, 06:02**

by **mcompany**

So, one of my friends was trying to make a game, but he ran across something that was a small problem on how to do something, long story short, I managed to figure out most of the components of projectile motion in two dimensions, but I don't know how to solve for either the x velocity or the y velocity, and I was wondering if someone could help. The components to solving it is:

Code: Select all

`x/a=t and t= c+d and c=-b/g and h =b*c+(1/2)*g*c^2 and d=sqrt(-2(y-h)(g))/g and a^2+b^2=v^2`

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

### Re: Physics math question

Posted: **22 Jul 2017, 06:31**

by **Kanishka**

Code: Select all

`(x/a)=(-b/g)+sqrt((-2(y-(((b*(-b/g))-b)/2)(g))/g`

### Re: Physics math question

Posted: **22 Jul 2017, 06:36**

by **mcompany**

You still haven't solved it yet (and I fear you messed up on that equation that you got)

### Re: Physics math question

Posted: **22 Jul 2017, 10:51**

by **Miojo**

mcompany wrote:So, one of my friends was trying to make a game, but he ran across something that was a small problem on how to do something, long story short, I managed to figure out most of the components of projectile motion in two dimensions, but I don't know how to solve for either the x velocity or the y velocity, and I was wondering if someone could help. The components to solving it is:

Code: Select all

`x/a=t and t= c+d and c=-b/g and h =b*c+(1/2)*g*c^2 and d=sqrt(-2(y-h)(g))/g and a^2+b^2=v^2`

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

It would be easier if you told us the problem instead of throwing the equations. What you want and what you have in terms of physics/math? Ex: You want the position (x,y) in a specific time (t) given an initial velocity vector (V) with its components (Vx and Vy) and an acceleration (Ax and Ay)?

### Re: Physics math question

Posted: **22 Jul 2017, 10:56**

by **Miojo**

A simple solution is:

X = X0 + Vx*T +0.5*(Ax*(t^2))

Y = Y0 + Vy*T +0.5*(Ay*(t^2))

Where X0 = initial X position , Vx=initial velocity in X axis, Ax = accel in X axis.

Y is similar.

To get Vx and Ax (and Vy and Ay) just decompose the velocity and accel vector in its components. Idk if this is what you need tho...

For example if it is just the "gravity" accel then Ay = -9.8 and Ax = 0

### Re: Physics math question

Posted: **22 Jul 2017, 11:15**

by **Kanishka**

mcompany wrote:You still haven't solved it yet (and I fear you messed up on that equation that you got)

Of course I did. -_-

### Re: Physics math question

Posted: **22 Jul 2017, 20:16**

by **mcompany**

Miojo wrote:mcompany wrote:So, one of my friends was trying to make a game, but he ran across something that was a small problem on how to do something, long story short, I managed to figure out most of the components of projectile motion in two dimensions, but I don't know how to solve for either the x velocity or the y velocity, and I was wondering if someone could help. The components to solving it is:

Code: Select all

`x/a=t and t= c+d and c=-b/g and h =b*c+(1/2)*g*c^2 and d=sqrt(-2(y-h)(g))/g and a^2+b^2=v^2`

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

It would be easier if you told us the problem instead of throwing the equations. What you want and what you have in terms of physics/math? Ex: You want the position (x,y) in a specific time (t) given an initial velocity vector (V) with its components (Vx and Vy) and an acceleration (Ax and Ay)?

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).

If you really want me to explain literally every part of the process to get to those equations, I can. Also, since I was trying to use some equation solvers later when I tried to solve it myself, I did reduce some variable into things that don't make sense, particularly "a" (the initial velocity x component), "b" (the initial velocity y component), "c" (a part of time solved in the y components), and "d" (another part of time solved in the y components). Do note that I actually did make 1 mistake in my calculations ( d=sqrt(-2(h-y)(g))/g ), but rest assured, it all is mostly solved for when it comes to the physics itself

(And no, gravity is not -9.8, and I myself don't know what he programmed gravity to be, but gravity is 100% constant and defined in his code)

### Re: Physics math question

Posted: **22 Jul 2017, 21:15**

by **TheKidPunisher**

The projectile havent a defined initial velocity or acceleration?

### Re: Physics math question

Posted: **22 Jul 2017, 21:19**

by **mcompany**

TheKidPunisher wrote:The projectile havent a defined initial velocity or acceleration?

Like I said, it is technically assumed that those are defined, but I am trying to solve using

**any** initial velocity or acceleration. Although, like I said, the acceleration for x is 0

### Re: Physics math question

Posted: **22 Jul 2017, 21:33**

by **Miojo**

Use the formulas that I said. Just decompose your velocity into Vx and Vy and solve for each.

### Re: Physics math question

Posted: **22 Jul 2017, 21:39**

by **mcompany**

Miojo wrote:Use the formulas that I said. Just decompose your velocity into Vx and Vy and solve for each.

What is "T" and "t" in your formulas?

### Re: Physics math question

Posted: **22 Jul 2017, 21:49**

by **TheKidPunisher**

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

Question, what is «h»? It looks like it is y

### Re: Physics math question

Posted: **22 Jul 2017, 21:57**

by **mcompany**

h was the highest point in the y direction that the object would go (when the velocity in the y direction is 0, and the object starts falling)

### Re: Physics math question

Posted: **22 Jul 2017, 22:00**

by **mcompany**

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

### Re: Physics math question

Posted: **22 Jul 2017, 22:10**

by **TheKidPunisher**

So sry i dont know what you search.

Also your projectile have a strange trajectory isnt it?

### Re: Physics math question

Posted: **22 Jul 2017, 22:13**

by **mcompany**

I don't think it is strange, just a normal parabola

### Re: Physics math question

Posted: **22 Jul 2017, 22:31**

by **TheKidPunisher**

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...

### Re: Physics math question

Posted: **22 Jul 2017, 22:43**

by **mcompany**

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"?

### Re: Physics math question

Posted: **22 Jul 2017, 23:00**

by **TheKidPunisher**

i think it is the same time (dont know why he put a maj on one the the time)

Also, the variable is X not Vx, you cant define a initial value by a variable that depend of the initial value. that does not make sense

### Re: Physics math question

Posted: **22 Jul 2017, 23:09**

by **mcompany**

TheKidPunisher wrote:i think it is the same time (dont know why he put a maj on one the the time)

Also, the variable is X not Vx, you cant define a initial value by a variable that depend of the initial value. that does not make sense

I guess, it makes sense for time in the first one (but time can't be solved for), but in the bottom you ate right that I doesn't make sense that one is capitalized and one is not

I rearraged the equation. I specifically am looking for Vs or By, and it is valid to be rearranged as such