Intersection between a horizontal plane and a torus. Problem with complex values

curvesintersection-theoryparametricparametrizationplane-geometry

[EDIT: I have replaced $a$ by $R_1$ in my previous post to make your reading and understanding easier, as this is a more general expression.]

I think I have a basic question but I cannot figure out an easy solution.
I am intersecting a torus with an horizontal plane, which I will move from the upper part to the bottom to calculate the area the intersections at different heights. Thus, I need to obtain the parametric curve equation of each intersection to compute the area as: $$A=\int{y(v) x'(v) dv}$$.

My problem is that I am unable to obtain a "closed" parametric curve, since there are certain complex values in the calculation that I cannot avoid. I obtain something like this when I cut the torus in the region between the inner and outter diameters:

intersection between plane and torus (parametric curve as black line)

Parametric intersection curve

Parametric intersection curve plus its negative counterpart

As can be seen, even trying to replicate the full geometry by the addition of the negative values parametric curve (just in case this solves something…), there is a small region that does not allow any connection to create a full closed curve to be integrated to obtain the enclosed area.

Does anyone know what am I doing wrong? I would appreciate any help a lot.

Details of my procedure:

Parametric equations of the torus:
$$ x(u,v) = R_2*\sin(v),$$
$$ y(u,v) = (R_1+R_2\cos(v))\cos(u), $$
$$ z(u,v) = (R_1+R_2\cos(v))\sin(u), $$
with $v \in [0, 2\pi]$, $u \in [0, 2\pi]$, $R_1$ the radial position of the center of the revolutioned circunference, and $R_2$ the radius of the said circunference in revolution.

Parametric equations of the plane:
$$z(x,y)=h,$$
with $h$ an specific height which will be varied. It is just a horizontal plane.

To obtain the parametric curves, I have to make equal both $z$ values:
$$(R_1+R_2\cos(v))\sin(u) = h, $$
Thus: $\sin(u) = \frac{h}{R_1+R_2\cos(v)}$. I can substitute this value in y(u,v) to obtain y(v) by either using $u=\arcsin(\frac{h}{R_1+R_2\cos(v)})$ or $\cos(u)=\sqrt{1-\sin(u)^2}$. By using the latter one, we can get the following parametric curve for the intersection:

$$ x(v) = R_2*\sin(v),$$
$$ y(v) = (R_1+R_2\cos(v))\sqrt{1-\left(\frac{h}{R_1+R_2\cos(v)}\right)^2}, $$
with $v \in [0, 2\pi]$.

When $\left(\frac{h}{R_1+R_2\cos(v)}\right)^2$ > 1, the square root yields the said problematic complex values.

Many thanks in advance for your time to read this post.

Best regards.

[EDIT: An easy working Matlab script to visualize this situation:]

close all;
R1=3; R2=1;
h=3.7; %Example of height
L1=4; L2=4; %some limits for the plane   

%Plane equation
syms u v
yp=v;
zp = h;
xp = u;
fsurf(xp, yp, zp, [-(L1 + 2*R1)/2, (L1 + 2*R1)/2 , -(L2 + 2*R2)/2, (L2 + 2*R2)/2], 'LineStyle', ls, 'FaceColor', 'm'); hold on;


%Torus equation
syms u v
%a=R1+R2; 
x_t = R2*sin(v);
y_t = (R1+R2*cos(v))*cos(u);
z_t = (R1+R2*cos(v))*sin(u);
fsurf(x_t, y_t, z_t, [0, 2*pi, 0, 2*pi], 'LineStyle', ls, 'FaceColor', 'g'); 

%Intersection
syms v
x_i = R2*sin(v);
y_i = (R1+R2*cos(v)).*(sqrt(1-(h/(R1+R2*cos(v)))^2) ) ;
z_i=h+v-v; %tricky to plot a 2D plot in a 3D figure
fplot3(x_i,y_i,z_i, [0, 2*pi], 'k-', 'LineWidth', 4); xlabel('x')
hold on

syms v
x_i = R2*sin(v);
y_i = -(R1+R2*cos(v))*(sqrt(1-(h/(R1+R2*cos(v)))^2) ) ;
z_i=h+v-v; %tricky to plot a 2D plot in a 3D figure
fplot3(x_i,y_i,z_i, [0, 2*pi], 'k-', 'LineWidth', 4); xlabel('x')
hold on

Best Answer

Hint:

Using the cartesian equation of the torus $$ \left(R_2-\sqrt{x^2+y^2}\right)^2+z^2=R_1^2 $$

you can arrive at an equation of the form $$ y=f(x,z) $$

Related Question