3D Theory - Collisions - from Forum

Delete By: TGA (the_great_apple) - 2008-04-03 12:22
Hi, 
 
From: https://www.euclideanspace.com/threed/games/examples/cars/collisions/index.htm 
 
"To rotate the vector through 90 degrees we just swap the x and y coordinates." This is untrue: 
 
(x, y) = (1, 1) 
(y, x) = (1, 1) 
 
Clearly not rotated 90 degrees. Swapping the x and y coordinates mirrors in the x-y plane, and so will seem to swap the coordinates if they lie on either axis. 
 
By 90 degrees are actually obtained by premultiplying the vector by the matrix: 
 
[0, 1 
-1, 0] 
 
for anti-clockwise rotations and: 
 
[0, -1 
1, 0] 
 
for clockwise rotations. 
 
In the article it doesn't matter if you rotate clockwise or anti-clockwise, so you could just say you swap the x and y coordinates, and make one negative. So: 
 
(x, y) = (1, 1) 
(-y, x) = (-1, 1) # 90 degrees clockwise 
(y, -x) = (1, -1) # 90 degrees anti-clockwise 
 
The example spreadsheet is also wrong with the same error. 

metadata block
see also:
Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.