본문 바로가기

Enginius/Matlab

Compute the distance from the cube and a point


Compute the distance from the point and the cube. Here, we use the method from:

https://math.stackexchange.com/questions/2133217/minimal-distance-to-a-cube-in-2d-and-3d-from-a-point-lying-outside


Followings are the MATLAB implementation of this method. 


Results:

Codes:

mian.m



get_ws_dist.m



plot_cube.m