|
|
Let |X - C|^2 = r^2 be the sphere and P the point. The distance between the point P and the hollow sphere is abs(|P - C| - r). Let D = (P - C) / |P - C|, then the closest point on the sphere to P is Q = C + r * D If P = C, then the closest point on the hollow sphere to P is any point of the sphere, for example C + r * (1, 0, 0).
|
Copyright © by Martin Ecker |