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
`4___3`

| |

1___2

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

Benjamin