- getting the angles of a right triangle we can use pythagorean theorem
- if we dont have a right angle trangle, we can break it up into manageable pieces and
- c^2 = (a sin theta) ^2 (b - a cos theta) ^2
- cimplifies to a^2 + b^2 - 2ab cos theta ← the adjustment we make based on theta

what we want is the angle between two vectors....
we have something to tell us c

- between 2 vectors a and b, we can draw another vector (a-b) to be the third side of a triangle

|a-b|^2 = |a|^2 + |b|^2 - 2|a||b| cos theta
|a-b|^2 = (a - b ) (.) (a-b)
= a (.) (a-b) - b (.) (a-b)
= a . a - a . b - b. a + b . b
= |a|^2 - 2a.b + |b|^2
|a|^2 + |b|^2 - 2|a||b| cos theta = |a|^2 - 2a.b + |b|^2
cos theta = a . b / |a||b| = ua . ub ?


dot product can also be used to project vector A onto vector B yielding a new vector C
C = uB(A . uB)
where uB is the unit vector of B
uB is the direction, A . uB is the length

unit vector is b/|b|

Projecting vector a on vector b with code
float dotProduct(point2 vector1, point2 vector2){
    return vector1[0]*vector2[0] + vector1[1] * vector2[1]
}

void unitVector2D(point2 vector1, GLfloat resultVector[]){
    float length = (float)sqrt(dotproduct(vector1, vector1))
    resultVector[0] = vector[0]/length
    resultvector[1] = vector[1]/length
}

setupVectors(){
    point2 unitB = {0,0}
    //generate 2 random vectors A and B
    unitVector2d(vectorB, unitB)
    v3ctorC[0] = unitB[0] * dotProduct2d(vectorA,vectorB)
    vectorC[0] = unitB[1] *
}



- Affine spaces
→ point + a vector space

Triangles: bi-linear interpolation

A plane can be determined by a point R and two vectors m and n
or by 3 points, where m = P-R and n is P-Q i think

Cross producs
u x v = (uyvz - uzvy, uzvx - uxvz, uxvy - uyvx)
- we can check if its perpendicular by taking the dot product of either of our vectors a or b with n... it should be 0
- a . n = [aybz - azby, azbx - axbz, axby-aybx] . [ax,ay,az]
- = (aybz-azby)ax + (azbx-axbz)ay + (axby-aybx)az

Index