How to find the closest point on a right rectangular prism ( 3d rectangle )

Viewed 1169

If I have a right rectangular prism with corners labeled as below.

enter image description here

and I have a random point q in 3D space how do I find the closest point on the cube to q

1 Answers
Related