how to find out...

Higher-dimensional geometry (previously "Polyshapes").

how to find out...

Postby -AB- » Mon May 16, 2005 4:27 pm

whether 4 points in 4D are a Square?

i was looking for a method to find squares in an unsorted array of (4D-)vertices... and because i do not know how to calculate the angles (in 4D ;)) i thought about how i would do in 3d (without angles):

vertices: p1, p2, p3, p4
Code: Select all
|   |

1) check whether lengths between p1-p2, p2-p3, p3-p4 and p4-p1 are equal
2) check whether the diagonals have the same length and
3) set diagonal d1=diagonal d2 and look whether they match on a point (did not know the word - think it is not 'cut' ;))

but i want to program that, and i don't like setting someting equal in C++ ;) (and especially not in four dimensions) so my next solution (for 3D) was:

3) calculate the cross product (p2-p1)x(p4-p1) and look whether it matches (p4-p3)x(p2-p3). if so, it is a square (afaik ;))

but does there exist a 4D-cross product? i simply could not imagine, i think there are always infinite possibilities.... well, i do not know, so i ask here ;)

sorry for bad english, but thx a lot for answers ;)

Posts: 1
Joined: Mon May 16, 2005 2:55 pm

Postby wendy » Mon May 16, 2005 11:07 pm

You can easily calculate angles via the dot or inner product. If what you are seeking is right angles, then x.y = 0.

That is, you pick three points A, B, C. You want to find the angle ABC

You then subtract B from A and C, ie A-B = A1-B1, A2-B2, A3-B3, ...

From here, you then take the inner product, ie

let L=A-B M = C-B, then L dot M = L1*M1+L2*M2+L3*M3+L4*M4

The value L.M will give you 0 only when ABC = 0.

In order to keep the thing cohedric (ie in the same 2-space), you will need to construct the hedrix by intersecting of two chorices.

That is, a hedrix is points satisfying a1.w + a2.x + a3.y + a4.z = a0
and b1.w + b2.x + b3.y + b4.z = b0

If you construct two vectors N, P such that L, M, N, P span 4-space you can make a matrix with these as the four columns. Take the inverse of this. This will give you l, m, n, p. If you then multiply l by the first matrix, you get a vector normal to MNP plane.
The dream you dream alone is only a dream
the dream we dream together is reality.
User avatar
Posts: 1816
Joined: Tue Jan 18, 2005 12:42 pm
Location: Brisbane, Australia

Return to Other Geometry

Who is online

Users browsing this forum: No registered users and 1 guest