🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Issue re-arranging equation

Started by
10 comments, last by Seer 6 years, 4 months ago

In the Introduction section of Ian Millingtons book "Game Physics Engine Development", he assumes that you have a certain level of mathematical knowledge. An example of what you are expected to understand is that x = 4 / t * sin(theta)^2 is the same as t = 4 / x * sin(theta)^2. I have tried to work this out but I cannot seem to resolve it at the last step. Here are my workings:

  • x = 4 / t * sin(theta)^2
  • t * x = 4 / t * t * sin(theta)^2 - (Multiply both sides by t to bring t over to the LHS)
  • t * x = 4 * sin(theta)^2 - (The ts on the RHS cancel out)
  • t * x / x = 4 * sin(theta)^2 / x - (Now divide both sides by x to remove the x from the LHS)
  • t = 4 * sin(theta)^2 / x - (This is what I have ended up with)

What I have ended up with is the whole of the right hand side of the equation over x. Ian Millington ends with only the 4 being divided by x. What am I misunderstanding here? My current understanding is that what is done to one side of the equation must be done to the other in order for it to remain true. Therefore, if all of the left hand side is divided by x then all of the right hand side must be divided by x, not just 4. If this is true, then does that not mean that sin(theta)^2 must also be divided by x? If so, how can this be resolved? Thanks.

 

Apologies for the formatting, I cannot figure out how to use the formatter.

Advertisement

It seems to me this would be clearer with parentheses.

 

x = 4 / (t * sin(theta)^2) -- multiply both side by t

t * x = 4 * t / (t * sin(theta)^2) --t's cancel out, leaving

t * x = 4 / (sin(theta)^2) -- divide both sides by x

t * x / x = 4 / (x * sin(theta)^2) -- x's cancel out, leaving

t = 4 / (x * sin(theta)^2)

Hello to all my stalkers.

Ah, sorry you're right that's not very clear, it should be:

x = (4 / t) * sin(theta)^2 is the same as t = (4 / x) * sin(theta)^2

  • x = (4 / t) * sin(theta)^2
  • t * x = (4 / t) * t * sin(theta)^2 - (Multiply both sides by t to bring t over to the LHS)
  • t * x = 4 * sin(theta)^2 - (The ts on the RHS cancel out)
  • (t * x) / x = (4 * sin(theta)^2) / x - (Now divide both sides by x to remove the x from the LHS)
  • t = (4 * sin(theta)^2) / x - (This is what I have ended up with)
1 hour ago, Seer said:

t = (4 * sin(theta)^2) / x - (This is what I have ended up with)

t = (4*sin(theta)^2) / x is equivalent to  t = (4/x)*sin(theta)^2

Keep in mind that 4/x == 4 * (1/x), and multiplication is associative, so you can reorder multiplied terms at will.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

18 hours ago, swiftcoder said:

t = (4*sin(theta)^2) / x is equivalent to  t = (4/x)*sin(theta)^2

Would you mind explaining how? Obviously I'm wrong but to my mind t = (4 * sin(theta)^2) / x is the same as t = (4 / x) * (sin(theta)^2 / x), since both 4 and sin(theta)^2 are divided by the x.

 

18 hours ago, swiftcoder said:

Keep in mind that 4/x == 4 * (1/x)

This makes sense to me, but I'm not making the logical connection between this and the equation.

 

18 hours ago, swiftcoder said:

multiplication is associative, so you can reorder multiplied terms at will

I don't understand. Would you mind explaining further?

 

Maths is not my strong point. It was just recently that I learned how to solve for variables in an equation and to re-arrange equations. It's incredible really, I feel like I have unlocked so many doors with this knowledge. No longer is it a mystery to me how expressions like "y = sin(theta) * radius" are arrived at. I had always understood through SOHCAHTOA that sin(theta) = y / radius, but I never understood how it was that people could re-arrange that to the equation above. It really is a great feeling when you make logical connections in your brain and finally understand what you did not before. Hopefully you can help me to make the connections to demystify my mystified brain on this issue.

Ok, start with your: t = (4*sin(theta)^2) / x 

That is equivalent to this, yes? t = 4 * sin(theta)^2 * (1/x)

Now rearrange the terms (since it's just multiplication): t = 4 * (1/x) * sin(theta)^2

And then multiply the first two terms: t = (4/x)*sin(theta)^2

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Okay, I understand reordering terms when multiplying, I just didn't know what you meant by associative. However, I don't understand how you got from:

t = (4*sin(theta)^2) / x 

to

t = 4 * sin(theta)^2 * (1 / x)

 

Let's just take the right hand side. I understand that 4 / x is equal to 4 * (1 / x) because:

4 * (1 / x) = (4 / 1) * (1 / x) = 4 * 1 / 1 * x => 4 / x

 

However, the right hand side of the equation isn't 4 / x, if it was it would already be solved. sin(theta)^2 is part of the numerator. This must be where my knowledge fails, because as I understand it everything in the numerator must be divided by the denominator. This would mean that both 4 and sin(theta)^2 must each be divided by x. Am I incorrect in thinking that? Can you pick and choose which term in a set of terms in the numerator to divide by the denominator? 

18 minutes ago, Seer said:

However, I don't understand how you got from:

t = (4*sin(theta)^2) / x 

to

t = 4 * sin(theta)^2 * (1 / x)

Ok, so I think something that may be causing confusion here is that the parentheses in the first version are purely there to clarify that the '/x' isn't part of the exponent. They don't actually influence the order of operations.

i.e. (a*b^2)/c is just another way of writing a*(b^2)/c 

So (4*sin(theta)^2) / x is the same as 4*(sin(theta)^2) / x which is the same as 4*(sin(theta)^2) * (1/x)

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

2 hours ago, Seer said:

to my mind t = (4 * sin(theta)^2) / x is the same as t = (4 / x) * (sin(theta)^2 / x), since both 4 and sin(theta)^2 are divided by the x.

The closely-related nature of multiplication and division means that this is simply not true.

Any division can always be re-written as a "multiplication of the numerator value with the reciprocal of the denominator value" and vice-versa. Which is just a fancy of saying this:

a / b == a * (1/b)

We can apply this rule to a more complex example:

(a * b) / c == (a * b) * (1/c)

Notice this is now the same shape as your equation if you just substitute: a == 4, b == sin(theta)^2 and c == x.

Ok, so the next step is to know that multiplication is associative.  Meaning that it doesn't matter which order we use to collapse terms together (e.g. (2*3)*4) == 2*(3*4)). Since the order doesn't matter we can safely discard parenthesis for associative operators like multiplication:

(a * b) * (1/c) == a * b * (1/c)

The other useful property about multiplication is that it is commutative. This simply means that we can safely re-arrange the sequence of operands without changing the result (e.g. 4*5 == 5*4):

a * b * (1/c) == a * (1/c) * b

The final step is to recognise that we can convert a * (1/c) into simply a/c by applying our original rule about the relationship between multiplication and division, only in this time reverse.

This gives us:

a / c * b

Let's replace a,b & c with your terms to arrive at your final result:

a = 4,
b = sin(theta)^2
c = x

a / c * b == 4 / x * sin(theta)^2 

 

On 3/6/2018 at 11:54 PM, Seer said:

x = 4 / t * sin(theta)^2  ==  t = 4 / x * sin(theta)^2.

Substation is a easy way that anyone can use to solve this problem.

a = b/c * D  ->  c = b/a * D Substitute every thing for a variable.

a = 1/2 * 3  Substitute all variables for simple numbers except the a.

1/2 * 3 = 1.5 Solve a. 

1.5 = 1/2 *3 -> 2 = 1/1.5 * 3

Now lets try your way.

1.) 1.5 * 2  =  (1/2*2) * 3  "(Multiply both sides by t to bring t over to the LHS)"

2.) 1.5 * 2 = 1*3 " (The ts on the RHS cancel out)"

3.) (1.5 * 2) / 1.5 = (1*3)/ 1.5   "(Now divide both sides by x to remove the x from the LHS)"

4.) 2 = (1*3)/ 1.5  "(This is what I have ended up with)"

Correct! You where never wrong you just stopped too early.

5.) 2 = (1/1.5) * 3 See Solved. or  t= (4/x) * sin(theta)^2

On 3/6/2018 at 11:54 PM, Seer said:

What I have ended up with is the whole of the right hand side of the equation over x. My current understanding is that what is done to one side of the equation 

On 3/7/2018 at 12:38 AM, Seer said:

t * x = (4 / t) * t * sin(theta)^2 - (Multiply both sides by t to bring t over to the LHS)

The same thing happens in your first step.

(x) *t = ((4/t)* sin(theta)^2) *t - (Multiply both sides by t to bring t over to the LHS)

multiplication and divisionBODMAS

This topic is closed to new replies.

Advertisement