Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Find a orthogonality vector based on two existing vectors
line1 = a*i + b*j + c*k
line2 = d*i + e*j + f*k
line3 = x*i + y*j + z*k
line1 .* line3 = ax + by + cz = 0
line1 .* line3 = dx + ey + fz = 0
z = -(ax + by)/c
0 = d*x + e*y - f*(a*x + b*y)/c
= d*x + e*y - f*a*x/c -f*b*y/c
= d*x - f*a*x/c + (e - f*b/c)*y
x / (f*b - e*c) = y / (d*c - f*a) = z / (a*e - b*d)
(0, (f*b - e*c), (d*c - f*a), (a*e - b*d))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.