Followers 0

# Math for 3d programming

## 4 posts in this topic

Just picked up the book Mathematics for 3d Game Programming by Eric Lengyl and Ive realized I need a precursor to it. My last math course was math 30 pure and I'm finding it hard to find something to fill the gap. The book starts with vector math for example, googling it for tutorials hasn't gotten me anywhere. There are tutorials but the dont match up with the proofs in the book. Most of what I see in the book I can work out but the proof for ||[i]a[/i][b]P[/b]|| = |[i]a| ||[/i][b]P[/b][i]|| [/i]is completely beyond me. Maybe its just the normalized notation thats throwing me off but why the root sum of a^2 P^2 is |[i]a| ||[/i][b]P[/b][i]|| [/i]confuses me. Why do the variables get normalized when the square root is taken, if I'm writing that right (dont know how to post mathematical notations)?

Anyone know of a good place to get the gap between highschool math and this book filled in? Ill be taking university math courses in the fall as prep for 3d game programming but for now Id like to work through this book.

Thanks,
Ryan.
0

##### Share on other sites
||apP|| = |a||P|: This is true assuming a and P are vectors facing the same or opposite directions. After all, a*P = |a||P|cos(theta) so |aP|=|a||P||cos(theta)|, where theta is the angle between a and P. So if theta=0, |a*P| = |a||P|*1=|aP|. If theta=pi, |aP|=|a||P||-1|=|aP|.

a^2*P2 = |a||P|: This is not true at all. It implies a^2=|a| and P^2=|P|, when in fact |a|=sqrt(a^2). If you give a and P values (like a=<x0,y0> and P=<x1,y1>) you can instantly disprove that statement except for when |a|=1 and |P|=1.

Vectors are normalized after taking the square root: Again, not true. A vector is normalized when it is of length one. This happens when you divide a vector by its magnitude.[code]//Example
a=<3,4>

|a| = sqrt(9 + 16) = 5
n = a/5 = <3/5,4/5> // n for Normal
|n| = sqrt( 9/25 + 16/25) = 1[/code]

Either what you're reading is inaccurate or there are some things you're not understanding yet. Hope this helps.
0

##### Share on other sites
[size="2"][color="#1C2837"]a^2*P2 = |a||P| [i]i think [/i]should read sqrt([/color][font="sans-serif"]?a[sup]2 [/sup]P[sub]i[/sub][sup]2[/sup]) = [/font][/size][color="#1C2837"][size="2"]|a||P|, where i=1. I'm sure its me and not the book, but your post is concise enough that I think I know what to read up on now to get a proper foothold.[/size][/color]
[color="#1C2837"] [/color]
[color="#1C2837"][size="2"]Edit for future reference: |a| ||P|| = ||aP|| is referring to [/size][/color][font=sans-serif][size=2][url="http://en.wikipedia.org/wiki/Absolute_value"]Positive homogeneity or positive scalability[/url]. |a| is an absolute scaler while ||P|| is a magnitude.[/size][/font]
0

##### Share on other sites
[quote name='ryan mccabe' timestamp='1303324712' post='4800875']
Most of what I see in the book I can work out but the proof for ||[i]a[/i][b]P[/b]|| = |[i]a| ||[/i][b]P[/b][i]|| [/i]is completely beyond me. Maybe its just the normalized notation thats throwing me off but why the root sum of a^2 P^2 is |[i]a| ||[/i][b]P[/b][i]|| [/i]confuses me.
[/quote]

Let [b]P[/b] be a vector and [i]a [/i]a scalar. There are scalars [i]x_1, x_2, x_3[/i] such that [b]P[/b] = ([i]x_1, x_2, x_3[/i]). [i]a[/i][b]P[/b] = ([i]ax_1, ax_2, ax_3[/i]) is always a vector by the vector space axioms. So just take the norm of [i]a[/i][b]P[/b]:.

||[i]a[/i][b]P[/b]|| = sqrt( ([i]ax_1[/i])^2 + ([i]ax_2[/i])^2 + ([i]ax_3[/i])^2) = sqrt([i]a[/i]^2([i]x_1[/i]^2 + [i]x_2[/i]^2 + [i]x_3[/i]^2)) = sqrt([i]a[/i]^2) * sqrt ([i]x_1[/i]^2 + [i]x_2[/i]^2 + [i]x_3[/i]^2) = |[i]a[/i]| ||[b]P[/b]||. I don't know of any books for bridging the gap. This stuff comes from vector calculus but you also see it in linear algebra.
1

##### Share on other sites
If you do a search on youtube for Linear Algebra MIT, you can find an entire semester's worth of Linear Algebra courses that should give you all the groundwork you need.
0

## Create an account

Register a new account