Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It generalizes perfectly. The angle between two lines in any dimensions is the same concept.

Two (non-collinear) lines share a plane. The angle on that plane is just the ordinary angle, no matter how many dimensions the two lines are embedded in.

In the case they are collinear, the angle between them is zero on any plane that intersects them. So that corner case works too, regardless of numbers of dimensions.



> Two (non-collinear) lines share a plane. The angle on that plane is just the ordinary angle, no matter how many dimensions the two lines are embedded in.

Okay, but now you've got a plane in n-dimensional space. How do you define/calculate the angle between the two vectors without falling back on the dot product?

You could say: The angle between the two vectors A and B is defined as the smallest rotation around their common normal vector so that the rotated first vector points in the same direction as the second vector. But what is the normal vector? It's a third vector C which is 90° to each of A and B. Now your definition is cyclic. Okay, then: C is a non-zero vector so that dot(A,C)=0 and dot(B,C)=0. Now you're back to using dot-products for defining angles in higher-dimensional space.


The normal vector is the cross product of the two vectors.

u = [u1 u2 u3] v = [v1 v2 v3]

in dimensions i, j, k

u x v = determinate of this matrix:

  =  | i  j  k|
     |u1 u2 u3|
     |v1 v2 v3|

  = (u2v3-v2y3)i - (u1v3 - v1y3)j + (u1v2 - v2u2)k


That works for 3D space. What about n-dimensional vectors?


You just do the cross product for n dimensions which is the determinant with n dimensions. [i j k m ...], with vector u, v, w, s, ....

Its the same for all dimensions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: