Finding the point of contact between an axisymmetric surface and a tangent line this is my first time posting on this website. I tried to search for this exact problem here but I couldn't get any results.
Anyways. I'm doing research concerning filament winding over containers/vessels and I'm confronted to the following mathematical problem:
1 - Consider an orthonormal basis $(\vec{e_x}, \vec{e_y}, \vec{e_z})$ and, on the $(xOz)$ plane we draw a curve $z(x)$ defined for $x\in[x_t, x_b]$ (with $x_t<x_b$) such that :

*

*$z(x_b)=z_b=0$ and $z(x_t)=z_t$ and $z(x_t)>z(x_b)$ (i.e. $z(x_t)$ is strictly positive),

*$z(x)$ is $C^1$ continuous, and (for the moment) strictly monotone, i.e. strictly decreasing. Since $z(x)$ is bijective, we can easily find $x(z)$.

Now, the curve $z(x)$ is going to revolve around the $z$-axis for a full rotation and creates a surface $S(x,y,z)$. Using polar coordinates for the axisymmetric surface, the expression of $S$ will be reduced to the notation $r(z)$, so that:

*

*$S(x,y,z)=S(r\cdot cos\theta,r\cdot sin\theta,z)$ with $\theta\in]-\pi, \pi]$. For $\theta=0$, we find the original 2D profile $x(z)$.

*We put $r_b=x_b$, so that $r_b$ is the radius of the bottom surface formed by $S$.

Consider now a circle $\mathscr C_1$ centered at the origin $(0,0,0)$, with a radius $r_m$, with $r_m>r_b$ and consider the point $A(r_m, 0, 0)$ (note: point A can be anywhere on $\mathscr C_1$, but for simplicity, I'll put it at this location since the base can always rotate to find this disposition).
Now, this is when it gets complicated for me. A fiber, exemplified as a mathematical line (or segment if you will), will begin at point A and forms an angle $\alpha_{att}$, called the angle of attack, with the meridian plan $\mathscr M$, the plane crossing the three point $A$, $O$ (origin) and $(0,0,1)$. In this case, $\mathscr M$ would be $(xOz)$ plane. The fiber is supposed to come into contact with the curved surface $S$ at point $B$. My problem is then trying to find the coordinates for this point $B$.
Here is a sketch I made using GeoGebra to make things clear :
3D intersection of surface S and fiber path
Here is what I tried to do :

Obviously, there are cases where there is no intersection whatsoever. There is a condition on the value of the angle of attack $\alpha_{att}$ which ensures that a contact occurs : $$\alpha<arctan\left(\cfrac{r_b}{r_m}\right)$$We will consider that this is always the case. Now, what we don't know about the fiber path is really the $z$-elevation, since its direction projected on the $xOy$ plane is defined by $\alpha$. Therefore the fiber line belongs to the plane that passes through $A$ and and oriented along the normal vector $(sin\alpha_{att}, cos\alpha_{att},0)$ (shown in red in the figure above). The equation of the plane is: $$x\cdot sin\alpha_{att}+y\cdot cos\alpha_{att}-r_msin\alpha_{att}=0$$
However, the parametric equation is probably more suitable for this problem : \begin{equation}\begin{cases} u \\ (r_m-u)\cdot tan\alpha_{att} & \text{          } & \forall u,v\\ v \end{cases}        \end{equation}
I tried to find the intersection between this plane and the surface $S$, which is a curve that should be determined. So, to parameterize curve $S$, we have : $$\begin{equation}\begin{cases} r cos\theta \\ r sin\theta & \text{for} & \theta \in ]0, \pi] \text{     and      } r\in[r_t, r_b]\\ z(r) & \text{          } & \ \text{z is known}\end{cases}        \end{equation}$$
I restricted the domain for $\theta$ to be positive because, for all practical purposes, $\alpha_{att}>0$
Now here is where I am stuck. The parameterization for the intersection between the plane and $S$ is : \begin{equation}\begin{cases} u \\ (r_m-u)\cdot tan\alpha_{att} & \text{          } & \text{for} & u\in \text{?}\\ z\left[\sqrt{u^2+(r_m-u)^2\cdot tan^2(\alpha_{att})}\right] \end{cases}        \end{equation}
the last equation for $z$ stems from identifying $r$ as : $r = \sqrt{(rcos\theta)^2+(rsin\theta)^2} = \sqrt{u^2+(r_m-u)^2\cdot tan^2(\alpha_{att})}$. I can't work out the exact domain for $u$.
My second problem is to find a way to identify the point of contact $B$ so that the fiber path is tangent to the parameterized curve (if multiple peaks are present - I think there is only one because of the monotonic nature of $z(r)$ but I'm not sure, the fiber line must be tangent near the highest peak, so that there are no intersections between the fiber path and the surface $S$.

I hope I was clear enough in stating my problem.
 A: Giving a revolution surface around the $z$ axis
$$
G(x,y,z) = f\left(\sqrt{x^2+y^2}\right)-z=0
$$
and a plane parallel to the $z$ axis
$$
(p-p_0)\cdot\vec n = 0
$$
with
$$
\cases{
p = (x,y,z)\\
p_0 = (x_0,y_0,z_9)\\
\vec n = (a,b,0)
}
$$
the line representing the contact fiber can be described as
$$
L\to p = p_0+\lambda \vec v
$$
This line and the contact point $p^*$ should obey some conditions as follows
$$
\cases{
G(p^*) = 0\\
p^* = p_0 + \lambda^* \vec v^*\\
(p^*-p_0)\cdot \vec n=0\\
\vec v^*\cdot\vec n = 0\\
\nabla G(p^*) \cdot \vec v^* = 0
}
$$
Those are $7$ equations and $7$ unknowns $(p^*,\vec v^*, \lambda^*)$. Attached a MATHEMATICA script solving this system for the case study
$$
\cases{
f(x) = 3\cos x\\
p_0 = (2,-2,0)\\
\vec n = (2,1,0)
}
$$
[x_] := 3 Cos[x]
G[x_, y_, z_] := f[Sqrt[x^2 + y^2]] - z
gradG = Grad[G[x, y, z], {x, y, z}]
n = {2, 1, 0};
p = {x, y, z};
p0 = {2, -2, 0};
h = G[x, y, z];
g = (p - p0).n;
gr0 = ContourPlot3D[{h == 0, g == 0}, {x, -2, 2}, {y, -2, 2}, {z, 0, 4}, MeshFunctions -> {Function[{x, y, z, f}, h - g]}, MeshStyle -> {{Thick, Blue}}, Mesh -> {{0}}, ContourStyle -> Directive[Orange, Opacity[0.5], Specularity[White, 30]], SphericalRegion -> True]
v = {vx, vy, vz};
equs = Thread[p - p0 - lambda v];
equs = Join[equs, {G[x, y, z]}];
equs = Join[equs, {(p - p0).n}];
equs = Join[equs, {v.n}];
equs = Join[equs, {gradG.v}];
obj = equs.equs
sol = NMinimize[{obj, {x, y, z, vx, vy, vz, lambda} \[Element] Reals}, {x, y, z, vx, vy, vz, lambda}]
line = p0 + t v /. sol[[2]]
grline = ParametricPlot3D[line, {t, 0, 3}, PlotStyle -> {Thick, Red}];
Show[gr0, grline]


