How can I determine if a point (x, y, z) is within a Torus (r, R)?

567 Views Asked by At

Given a Torus centered about the origin (0, 0, 0) with parameters r (minor radius) and R (major radius), how can I mathematically determine if a point (x, y, z) is inside of the Torus? Is there a simple solution to this?

(Assume that the Torus is a "donut" with the Z axis going through the donut hole)

Thank you!

1

There are 1 best solutions below

0
On

Suppose we have a torus with the $z$ axis as its axis of rotation, the $xy$-plane as a plane of reflection, $R$ the radius of the circle along the center of the "tube," and $r$ the radius of any circular cross-section of the "tube."

Given any point $P=(\hat x,\hat y,\hat z)$ inside of the torus, there is necessarily a circular cross section of the tube--say with center $C=(x_0,y_0,z_0)$--having $P$ in its interior. Note that by our description of the torus, $z_0=0$ and $x_0^2+y_0^2=R^2.$ Note further that if $\hat R=\sqrt{\hat x^2+\hat y^2},$ the circle in the plane $z=\hat z$ of radius $\hat R$ with center on the $z$-axis passes through $P$ and lies entirely within the torus. Some basic trigonometry shows that the distance from $P$ to $C$ is given by $$\sqrt{\left(R-\hat R\right)^2+\hat z^2}.$$ Since $P$ lies within $r$ of $C,$ we have $$\sqrt{\left(R-\hat R\right)^2+\hat z^2}<r,$$ so $$\left(R-\hat R\right)^2+\hat z^2<r^2,$$ or $$\left(R-\sqrt{\hat x^2+\hat y^2}\right)^2+\hat z^2<r^2.$$

Thus, a general formula for a point $(x,y,z)$ inside such a torus is $$\left(R-\sqrt{x^2+y^2}\right)^2+z^2<r^2.$$ It's worth noting that this formula holds whether the torus is a "donut" ($R>r$), a "horn torus" ($R=r$), a "self-intersecting spindle torus" ($0<R<r$), or a sphere ($0=R<r$).