# If point in tilted cube.

DHack
I'm trying to figure out if a point is in a cube that could be tilted in any direction.
How would I do it? I can get anything you need for this problem.

## Answers and Replies

Homework Helper
Gold Member
Dearly Missed
I assume your cube is of fixed dimensions, but free to rotate/tilt about any of its initial edges/corners?

DHack
I assume your cube is of fixed dimensions, but free to rotate/tilt about any of its initial edges/corners?

Yep.

mikeph
I don't fully understand the question.

Are you saying you have a cube with a known orientation (eg. you are given a unit vector normal to a surface, and the cube centre is fixed at (0, 0, 0)), and want to know if a general point (x, y, z) is in that cube?

Try to develop a method of rotating the coordinate system from the original one to one where the cube sides are perpendicular to the coordinate axes. Then all you need to do is transform your point to this system and ensure it is between each side along all three dimensions.