Original Post
Hey all, I'm working my way through the early chapters of "Mathematics for game developers". Hope you can bear with me if the answers seem obvious... I've only just started to "improve" my maths knowledge, and think I've a lot of work ahead of me :P 1) As part of the first chapter Christopher Trembley takes the function f(x) = 2x^2 + 3x - 5 and substitutes x = y + a. I've worked through the steps myself and obtained the same final equation: 2y^2 + y(4a + 3) + a^2 + 3a -5. However, he then substitutes using 4a+3 = 0, so a = -3/4. Initially my answer remains the same has his up to the following step in the substitution: f(y) = 2y^2 + 9/16 + 3(-3/4) - 5 at which point he simplifies to 2y^2 - 49/8 I am unable to see how the equation simplifies to that. The best I can get is: 2y^2 - 45/16 - 5 Does anyone have any idea where I've gone wrong? Or is this an error with the book (probably me :P) 2) Regardless of final simplification which I'm stuck on atm... assuming I do manage to obtain his simplification of 2y^2 - 49/8, I have another question. Based on all the above, he takes an example using x=4. Plugging this into the first equation "2x^2 + 3x - 5" gives a result of 39. Plugging it in his "2y^2 - 49/8" equation it also gives 39. However, if you plug it into the unsimplified equation 2y^2 + y(4a + 3) + a^2 + 3a -5 I get a result of 37.3125. Given that x=y+a, then y=x-a and we have used a as -3/4, so y=4.75. How come this doesn't equal 39 as the simplified version does? I take it I'm doing something wrong, but I'm not sure what. I'd like to think its a mistake in the book thats driving me round in circles, but my lack of maths atm makes it hard for me to assume that :P One final question whilst I'm at it.... Given that (y+a)^2 = y^2 + 2ya + a^2 and using y=4 and a=-0.75 How come (y+a)^2 = 10.5625 yet, y^2 + 2ya + a^2 = 9.4375 I'm assuming the equation would apply as follows: 4^2 + 2*4*-0.75 + -0.75^2 = 4^2 - 2*4*0.75 - 0.75^2 = 9.4375 Or is this not how you would use the negative "a" in the equation? since doing 4^2 + 2*4*-0.75 + 0.75^2 gives the same answer as (y+a)^2 Can anyone clarify which is the correct way to handle a negative value of "a" when substituting it the equation. Any help greatly appreciated :) oh and has anyone found an errata list for the maths for game developers book? Or know of anyone maintaining an un-official listing?