Closest point of a disc to a plane 3D

321 Views Asked by At

I have a disc in a 3D space , the disc is created with a vector ( two points) passing in its center and a diameter.

Now what I need is to find the closest point on the circumference of the disc to the xy plane.

Basically I need to find the lowest point on the disc (in z axis).

I would like to have an help on this.

Thank you

1

There are 1 best solutions below

7
On

Let's say your disc is centered at $\vec{c} = ( x_C, y_C, z_C)$, radius $r$, and unit normal (disc axis) $\hat{a} = ( x_A, y_A, z_A)$, with $\lVert \hat{a} \rVert = x_A^2 + y_A^2 + z_A^2 = 1$.


If we wanted to solve the points where the circumference intersects the $xy$ plane at $z = 0$ (or any $z$ value):

The points $\vec{p} = (x, y, z)$ on the circumference are at distance $r$ from the center of the disc, $$\lVert \vec{p} - \vec{c} \rVert = r$$ and perpendicular to the axis of the disc, $$\left( \vec{p} - \vec{c} \right) \cdot \hat{a} = 0$$ Using Cartesian coordinates, the above requirements give us a pair of equations, $$\begin{cases} (x - x_C)^2 + (y - y_C)^2 + (z - z_C)^2 = r^2 \\ (x - x_C) x_A + (y - y_C) y_A + (z - z_C) z_A = 0 \end{cases}$$ Substituting $z$, we can solve for $x$ and $y$. (Typically, we get two possible $x$ values, and two $y$ values, so we substitute each of the four combinations to the above equations and verify which points are true solutions.)


The point on the circumference that has the smallest $z$ coordinate, is in the same direction on the $xy$ plane from the center $\vec{c}$ as the axis $\hat{a}$, if the axis points towards positive $z$; i.e. $z_A \gt 0$.

If the axis is on the $xy$ plane, i.e. $z_A = 0$, then the disc is perpendicular to the $z$ axis, and the point with the smallest $z$ coordinate on the circumference is at $(x_C, y_C, z_C - r)$, and the point with the largest $z$ coordinate on the circumference is at $(x_C, y_C, z_C + r)$.

If the axis is parallel to the $z$ axis ($\hat{a} = (0, 0, 1)$), then the disc is on the $xy$ plane, and all points on the circumference have the same $z$ coordinate.

Let's assume the axis points towards the positive $z$ half-space, i.e. $z_A \gt 0$. (If not, just negate $x_A$, $y_A$, and $z_A$ in all occurrences below.)

If we were to rotate the coordinate system around the center $\vec{c}$ and $z$ axis, so that the disc unit normal $\hat{a}$ is on the $xz$ plane, and to positive $x$, we'd have a right-angled triangle, Right-angled triangle with the center of the disc at the right-angle vertex $\vec{c}$, one vertex at the end of the disc normal $\hat{a}$, and the third vertex at the point on the circumference having the smallest $z$ coordinate.

One way to see this is that the slope of the blue line marked $r$ with respect to the $xy$ plane is the same as the slope of the disc normal vector $\hat{a}$ with respect to the $z$ axis, $\sqrt{x_A^2 + y_A^2}$.

Thus, at distance $r$ from the center of the disc $\vec{c}$, the point on the circumference that has the smallest $z$ coordinate, has $$z = z_C - r \sqrt{x_A^2 + y_A^2 }$$

We can solve $x$ and $y$ in similar fashion, noting that the slope this time is the inverse negative ($-1/\sqrt{x_A^2 + y_A^2}$) due to the right angle.

Also, the point on the circumference is in the same direction on the $xy$ plane as the disc unit normal $\hat{a}$ is, as mentioned earlier.

Therefore, with the assumptions that $\hat{a}$ is an unit vector, i.e. $$x_A^2 + y_A^2 + z_A^2 = 1$$ and that it is on the positive $z$ halfspace, not parallel to the $z$ axis, nor parallel to the $xy$ plane, i.e. $$0 \lt z_A \lt 1$$ we find $$\begin{cases} x = x_C + r \frac{x_A z_A }{\sqrt{x_A^2 + y_A^2}} \\ y = y_C + r \frac{y_A z_A}{\sqrt{x_A^2 + y_A^2}} \\ z = z_C - r \sqrt{x_A^2 + y_A^2 } \end{cases}$$

I'm not particularly happy with this description of the solution; I think it could be stated much more clearly and concisely. Good suggestions (in a comment) or edits to fix the language or clarify the explanations are more than welcome. (I did test a few thousand random cases numerically to verify the solutions, so I do trust the math. It's just that me fail English thus now.)