where sqr() is the square root. Try this at home boys and girls, itworks just ducky.He was an easy reference. Another reference was my 15 year old AlgebraII text book that I still kept around. Generally, I find text booksfairlyuseless as they are designed to have a teacher supplement them,and seem to make it difficult to find important information quickly bythe student (likethe formulas for exams, perhaps...). But I persevered,and managed to figure it out. It was just like riding a bicycle, exceptI kept falling off the damnthing. Now, my handy reference that I keep nearby is, of all things, "CliffsQuick Review - Trigonometry". Cliff notes for math. GREAT book. Theyalsodo Physics, and Geometry, and all sorts of things. Ask yourfavorite bookseller for details.We'll deal with a generic, 3D triangle that is not parallel with eitherplane that you've been able to draw. (The techniques work everywhere, ofcourse, but if you just drew it...well...anyway). If the shape you aredealing with is NOT a triangle, then you need to break it up intotriangles. If the shape issome kind of conic section (like theEnterprise Hull, but, say just a piece), then you are free to run awayscreaming into the night, as I'm not dealingwith that here. Or, you canchoose to make it into a whole bunch of triangles. But, while that maysolve the problem, running away into the night ismuch more satisfying.Step 1: Determine the lengths of the sides of the triangles.This is easy. Pythagoreans Theorem conveniently expands from twodimensions into three dimensions. I would imagine it would even work forfour dimensions, however this isn't TIME-MACHINE-L, so we'll stop there.Given two 3D points (x1, y1, z1) and (x2, y2, z2), you can find thelength of the line by:
length = sqr((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2)
We will call the lengths of the triangle A,B, and C. Also, we willassume that A represents the longest of the three lines.We will also call the angles OPPOSITE the lines a,b, and c respectively.
|\C |b\ A| \|a_c\B
Pardon the art, but I wanted to get the idea of opposite angles clear.Step 2: Solve for 'a'.This is a nice step, because it solves for the largest angle of thetriangle, and it is unambiguous. It will reveal immediately whether thetriangle is anacute ('a' less than 90 deg.), right ('a' equals 90deg.), or obtuse ('a' greater than 90 deg.).To do do this, we will use what is known as "The law of Cosines". TheLoC states:
A^2 = B^2 + C^2 - 2BC cos a
Where, as said earlier, A, B, and C are the lengths of the sides of thetriangle, and 'a' is the angle opposite 'A'. This relationship holds forall of theangles, not just 'a', but I won't list those.So, going to the year before Algebra II and using Algebra I, we solvefor 'cos a':
B^2 + C^2 - A^2cos a = -----------------2BC
Once we know the cosine of 'a', we can use the what is known as thearccosine, or acos, or cos^-1. Essentially, this is the function thatwhen given acosine will return the number of degrees that created thecosine.Filling in the variables, and using the arccosine, we now know what theangle 'a' is for the triangle. One down, two to go.Step 2: Solve for 'b'Here, we go to the brother of the LoC into the "Law of Sines". The LoS isrepresented like this:
sin a sin b sin c A B C----- = ----- = ----- or ----- = ----- = -----A B C sin a sin b sin c
Basically, the ratio of the triangle leg and the sin of the oppositeangle is the same for all of the legs in a triangle. Whoever thoughtthis stuff up was pretty durn crafty.So, we will use this capability to solve for 'b'.
B sin asin b = -------A
6/28/09 7:01 PMMathematics for Card ModelersPage 2 of 8http://www.cardfaq.org/faq/maths.html