Advertisement

How do you test if an ellipsoid is in a cube?

Started by July 18, 2002 04:59 PM
0 comments, last by executor_2k2 22 years, 7 months ago
Anyone? Thanks.
Well, that was a waste of 2 minutes of my life. Now I have to code faster to get 'em back...
Transform it to a sphere and then test that.

The transformation will be a scaling one along one or more axes of the ellipsoid. Apply this to the ellipsoid and cube. What you''ll get is a sphere inside a rhomboid. This is more compex than a cube but it still has six flat faces which you can test against, by working out the distance of the sphere''s centre from each and comparing it with the sphere''s radius.

The reason for doing it this way is that the mathematics of ellisoids is quite hard: solving problems with ellipsoids directly usually ivolves solving quartic equations or some variation on them, hard and computationally expensive to do.
John BlackburneProgrammer, The Pitbull Syndicate

This topic is closed to new replies.

Advertisement