(UPDATED) How do I find the intersection of this involute and trochoid, given their parametric equations? I have two parametric curves. The first, an involute of a circle with parameter theta:
$$x_1(θ) = Z × \cos(α) × (\cos(θ − \tan(α) + α) + θ × \sin(θ − \tan(α) + α)),$$
$$y_1(θ) = Z × \cos(α) × (\sin(θ − \tan(α) + α) − θ × \cos(θ − \tan(α) + α)),$$
$$0 ≤ θ_{min} ≤ θ ≤ θ_{max}$$
(note that theta must always be greater than or equal to zero)
And the second, a trochoid with parameter gamma:
$$x_2(γ) = (Z − 2 × (C − X)) × \cos(γ) + (Z × γ + 2 × \tan(α) × (C − X)) × \sin(γ),$$
$$y_2(γ) = (Z − 2 × (C − X)) × \sin(γ) − (Z × γ + 2 × \tan(α) × (C − X)) × \cos(γ),$$
$$γ_{min} ≤ γ ≤ γ_{max}$$
With four independent variables:

*

*$Z$ is a positive integer,

*$X$ is a real number in the interval $[−1, 1]$,

*$C$ is a real number in the interval $[1, 1.5]$, and

*$α$ is an angle in the interval $\left[0, \arctan\left(\frac{π}{4 × C}\right)\right]$,

And where:

*

*$θ_{max} = \frac{\sec(α)}{Z} × \sqrt{(2 × X + Z + 2)² − Z² × \cos(α)²}$,

*$γ_{max} = \frac{−2}{Z} × (C − X) × \tan(α)$, and

*$θ_{min}$ and $γ_{min}$ are the parameter values at the intersection that I want to find.

I know that the curves have a touching intersection (where their tangents are the same) at the parameter values $θ = \tan(α) − \frac{4}{Z} × (C − X) × \csc(2 × α)$ and $γ = \frac{−4}{Z} × (C − X) × \csc(2 × α)$. See the red and blue curves in the following picture.

However, when the values of the four variables are such that $α < \arcsin\left(\sqrt{\frac{2}{Z} × (C − X)}\right)$, two things happen. First, the expression for theta in the previous paragraph goes negative, which makes it invalid for my purposes. Second, a transversal intersection (where the curves' tangents are distinct) appears at values of gamma and theta closer to zero than those for the touching intersection, and specifically with a positive value of theta. See the red and blue curves in the following picture.

THE PROBLEM:
I want to find the parameter values $θ_{min}$ and $γ_{min}$ for this transversal intersection in terms of $Z$, $α$, $X$, and $C$, in all cases where $α < \arcsin\left(\sqrt{\frac{2}{Z} × (C − X)}\right)$, given the stated domains of the independent variables $Z$, $α$, $X$, and $C$. Additionally, when that inequality is true, $θ_{min}$ should always be strictly greater than zero.
When that inequality is not true, the value of any new expression for $θ_{min}$ can be anything, because I already have expressions that hold when the opposite of that inequality, $α ≥ \arcsin\left(\sqrt{\frac{2}{Z} × (C − X)}\right)$, is true.
HOW THESE CURVES ARE DEVELOPED
The curve with parameter theta is the envelope of the line described by the equation $y = x × \tan(α + β) - Z × \sec(α + β) × (β × \cos(α) + \sin(α))$ as the parameter $β$ varies from $-∞$ to $+∞$, specifically tracking the point with $(x, y)$ coordinates
$$(Z × \cos(α) × (\cos(α + β) + \sin(α + β) × (\tan(α) + β)),$$
$$Z × \cos(α) × (\sin(α + β) - \cos(α + β) × (\tan(α) + β)))$$
The curve with parameter gamma is the path of a specific point on that line, with $(x, y)$ coordinates
$$((Z - 2 × (C - X)) × \cos(β) + (Z × β + 2 × (C - X) × \tan(α)) × \sin(β),$$
$$(Z - 2 × (C - X)) × \sin(β) - (Z × β + 2 × (C - X) × \tan(α)) × \cos(β))$$
I've tried to find a way to relate the envelope of the line, and its generating point, with the path of the other point, without any success so far, but I'm hopeful that some way to do so does exist.
WHAT ELSE I KNOW
I do know that on the first curve, the radius of a point for a given value of theta is $r(θ) = Z × \cos(α) × \sqrt{θ² + 1}$, and conversely the value of theta for a given radius is $θ(r) = \sqrt{\frac{r²} {Z² × \cos(α)²} − 1}$. This means that if I can find the radius of the transversal intersection point by any process, I can easily convert it into the value for $θ_{min}$, and vice versa. I also know that the angle made with the $x$-axis by a point on the curve at a given value of theta is $β(θ) = θ − \arctan(θ) + α − \tan(α)$, which is transcendental and has no closed-form inverse, so I cannot use a known angle to find the value of theta.
Similarly, I know that for the second curve, the radius of a point for a given value of gamma is $r(γ) = \sqrt{(2 × \tan(α) × (C − X) + Z × γ)² + (Z −2 ×(C − X))²}$, and conversely the value of gamma for a given radius is $γ(r) = \frac{±\sqrt{r² − (Z − 2 ×(C − X))²} − 2 ×(C − X) ×\tan(α)}{Z}$. This means that if I can find the radius of the transversal intersection point by any process, I can convert it into the value for $γ_{min}$, and vice versa. I also know that the angle made with the $x$-axis by a point on the curve at a given value of gamma is $β(γ) = γ − \arctan\left(\frac{Z (γ + \frac{2}{3} ×(C − X) ×\tan(α))}{Z −2 ×(C − X)}\right)$, which is transcendental and has no closed-form inverse, so I cannot use a known angle to find the value of gamma.
Thus, if I get either one of $θ_{min}$ or $γ_{min}$, I can use that value to find the other. If I can find the radius of the intersection separately, I can use it to find both values. Given these expressions, I know that the radius of the touching intersection is $r = \sqrt{4 ×\cot(α)² ×(C − X)² + (Z − 2 ×(C − X))²}$, or equivalently $r = Z ×\cos(α) ×\sqrt{(\tan(α) − \frac{4}{Z} ×(C − X) × \csc(2α))² + 1}$. I've attempted to find similar expressions for the transversal intersection by working backwards from numerically-calculated values, without any success yet.
For example, by plotting the two curves in graphing software and numerically calculating the parameter values of their intersections to ten decimal places, I created this plot, which shows the $γ_{min}$ value against the pressure angle $α$ (including some technically-invalid negative values of $α$ to get a broader sample size) for four different values of $Z$, all with $X = 0$ and $C = 1$:

The green lines show the known expression $γ_{min}(α) = \frac{4}{Z} × (C − X) × csc(2 × α)$, while the red points are samples of the unknown expression for which I am searching. I've been trying to fit a curve to the red points, unfortunately without any success yet.
The points appear to trace out a sine wave of the form $γ_{min}(α) = A × \sin(ω × α + φ)$, where

*

*$A$ is the amplitude,

*$ω$ is the angular frequency, and

*$φ$ is the phase.

I do know the transition point between the known and unknown functions exactly, as well as the slope of the known function at that point (which appears to also be the slope of the unknown function at said point). The point is $P = \left(\arcsin\left(\frac{\sqrt{2 × (C − X)}} {\sqrt{Z}}\right), \frac{\sqrt{2 × (C − X)}} {\sqrt{Z − 2 × (C - X)}}\right)$, and the slope of the function at that point is $m = \frac{4 × (C − X) − Z} {Z − 2 × (C − X)}$. However, as far as I can tell this isn't enough information to derive the three unknown variables in my hypothesized sine function. Additionally, my attempts to fit a sine curve to the numerically-calculated points suggest that the sampled function isn't a perfect sine wave and may be modified with some other term(s), the effect of which is particularly noticeable for small values of $Z$. At the very least, the red points for $Z = 8$ have proved much more difficult to get a sine wave to conform to than the points for higher $Z$ values. My best attempts so far are:

*

*$0.794 × \sin(1.20 × α + 1.70)$ for $Z = 8$,

*$0.664 × \sin(1.50 × α + 1.77)$ for $Z = 12$,

*$0.484 × \sin(2.18 × α + 1.83)$ for $Z = 24$, and

*$0.248 × \sin(4.30 × α + 1.89)$ for $Z = 96$.

As stated above, if I can find the equation that describes the red points and thus the value of $γ_{min}$, I can use that to also find the value of $θ_{min}$, which would completely solve my problem.
AN APPEALING BUT FLAWED APPROACH:
Another approach that has been tried to solve this is to create the new variables

*

*$A = Z × \cos(α)$,

*$B = Z − 2 × (C − X)$,

*$ψ(θ) = θ − \tan(α) + α$, and

*$ξ(γ) = 2 × \tan(α) × (C − X) + γ × Z$.

Then the parametric equations can be re-written as:
$$x_1(θ) = A × \cos(ψ(θ)) + A × θ × \sin(ψ(θ)),$$
$$y_1(θ) = A × \sin(ψ(θ)) − A × θ × \cos(ψ(θ))$$
and
$$x_2(γ) = B × \cos(γ) + ξ(γ) × \sin(γ),$$
$$y_2(γ) = B × \sin(γ) − ξ(γ) × \cos(γ)$$
Because the two curves intersect when $x_1(θ) = x_2(γ)$ and $y_1(θ) = y_2(γ)$, with these re-written equations we can see that an intersection exists when $A = B$, $A × θ = ξ(γ)$, and $γ = ψ(θ)$. This gives the following equations:

*

*$Z × \cos(α) = Z − 2 × (C − X)$

*$Z × \cos(α) × θ = 2 × \tan(α) × (C − X) + Z × γ$

*$γ = θ − \tan(α) + α$
With some rearranging, substitution, and simplification, these become:

*

*$α = \arccos\left(\frac{Z − 2 × (C − X)} {Z}\right)$

*$θ = \frac{α − \sin(α)} {\cos(α) − 1}$

*$γ = θ − \tan(α) + α$
This does produce an intersection of the two curves, but it fails for my purposes on several accounts:

*

*The first of these three equations fixes the value of alpha in relation to the other three variables $Z$, $X$, and $C$. In reality, alpha is an independent variable whose value in this problem is constrained by, but not dependent on, the values of the other variables. Moreover, for most combinations of values of the other three variables, the value produced by this equation is outside the domain of alpha that I specify at the beginning of this question.

*My problem has the specific constraint that a solution must be valid when $α < \arcsin\left(\sqrt{\frac{2}{Z} × (C − X)}\right)$, and the value of alpha from that first equation is always greater than or equal to the right side of this inequality, so it is always invalid.

*The second equation produces a value of theta that, using the value of alpha from the first equation, is always negative or zero. For my problem the value of theta must be strictly greater than or equal to zero, so this part is also almost always invalid.

I've played around a bit with this approach, but I haven't been able to modify it to make it work.
THE CONTEXT:
The curve with parameter theta is the involute face curve of a tooth on an involute gear, while the curve with parameter gamma is the trochoid root curve of the same tooth. These curves are naturally generated in real life by the gear-shaping process called hobbing, without needing any fancy math. Representing them in a computer, which I want to do, is more difficult.
The shapes of these curves are defined by four variables:

*

*$α$, the angle of the contact force between meshed gear teeth, called the pressure angle;

*$Z$, the number of teeth on the gear;

*$X$, the profile shift coefficient, specifying how far in or out the cutting tool is moved compared to cutting a standard gear profile; and

*$C$, the clearance factor, specifying how much clearance there is between the tooth roots on one gear and the tooth tips on a meshing gear as a multiple of the overall tooth height.

There is one more gear design variable, called module or pitch, which describes the overall size of the gear. Because this variable is a uniform scaling factor, it has no effect on the angles involved or on the values of theta and gamma, so I have left it out of the equations for the sake of simplicity.
When $α ≥ \arcsin\left(\sqrt{\frac{2}{Z} × (C − X)}\right)$, the involute face curve transitions smoothly into the trochoid root curve (with a touching intersection). However, when $α < \arcsin\left(\sqrt{\frac{2}{Z} × (C − X)}\right)$, the root curve cuts off some of the face curve (with a transversal intersection). This is called undercutting and is in general undesirable, as it reduces the strength of the gear. However, small amounts of undercutting are tolerated in many situations. I want to find the point on each curve where this undercutting occurs so I can accurately draw an undercut gear in software.
This question is very similar to another question on this site, but that question's answer doesn't address my particular problem.
 A: Setting the parameterized coordinates equal to each other appears to give an intractable transcendental system in $\theta$ and $\gamma$, whose solution almost-certainly require numerical methods.
We can make a little progress by equating the $x^2+y^2$ expressions for each curve's parameterization, which conveniently gives an algebraic relation between $\theta$ and $\gamma$. Referring to my recent answer to a related question for the trochoid half of this discussion, we have
$$\begin{align}
x^2+y^2\,\mid_{\text{inv}}\quad&=\quad x^2+y^2\,\mid_{\text{tro}} \tag1\\[6pt]
\tfrac14 m^2Z^2 \cos^2\alpha\left(1 + \theta^2\right)\quad&=\quad\tfrac14m^2Z^2\left(1+\gamma_0\sin2\alpha+\gamma^2\cos^2\alpha+(\gamma-\gamma_0)^2\sin^2\alpha \right) \tag2  \\[6pt]
\theta^2\quad&=\quad\gamma^2+2\gamma_0\tan\alpha+\left(1+(\gamma-\gamma_0)^2\right)\tan^2\alpha \tag3  \\[6pt]
\end{align}$$
where $\gamma_0 := -4(C-X)\csc(2\alpha)/Z$. This gives us $\theta$.
So, "all we have to do" is substitute the formula for $\theta$ into this $x\mid_\text{inv}=x\mid_\text{tro}$ equation (here again referring to my previous answer for the trochoid formula) ...
$$\cos\alpha \left(\cos(\theta-\phi) + \theta \sin(\theta-\phi) \right)
= \cos\gamma + \gamma \sin\gamma + \gamma_0 \cos(\alpha + \gamma) \sin\alpha \tag4$$
... and solve for $\gamma$.
Even with numerical methods, that process looks downright painful, and I'm not sure if I've ever been happier to write: This is left as an exercise to the reader. :)
A: We have
$$
p_1(\theta) = \cases{
z \cos (\alpha ) (\theta  \sin (\alpha -\tan (\alpha )+\theta )+\cos (\alpha -\tan (\alpha )+\theta ))\\
z \cos (\alpha ) (\sin (\alpha -\tan (\alpha)+\theta )-\theta  \cos (\alpha -\tan (\alpha )+\theta ))
}
$$
$$
p_2(\gamma) = \cases{
\sin (\gamma ) (2 \tan (\alpha ) (c-x)+\gamma  z)+\cos (\gamma ) (z-2 c+2 x)\\
\sin (\gamma ) (z-2 c+2 x)-\cos (\gamma ) (2 \tan (\alpha ) (c-x)+\gamma z)
}
$$
The equations to solve are of transcendent type so numerical methods are indicated to solve them.
The intersections are when $\Delta p = p_1(\theta) - p_2(\gamma)=0$. Those intersections can be visualized with the command
gr1 = ContourPlot[{dp[[1]] == 0, dp[[2]] == 0}, {theta, -Pi/4, Pi/4}, {gamma, -Pi/4, Pi/4}]

showing the solutions dependence on $(\theta,\gamma)$, providing a good guess to give initial conditions to a numeric iterative procedure which would provide solutions. Follows a MATHEMATICA script which serves this purpose.
Clear["Global`*"]
p1[theta_] := {z Cos[alpha] (Cos[theta - Tan[alpha] + alpha] + theta Sin[theta - Tan[alpha] + alpha]), 
               z Cos[alpha] (Sin[theta - Tan[alpha] + alpha] - theta Cos[theta - Tan[alpha] + alpha])}
p2[gamma_] := {(z - 2 (c - x)) Cos[gamma] + (2 Tan[alpha] (c - x) + z gamma) Sin[gamma], 
               (z - 2 (c - x)) Sin[gamma] - (2 Tan[alpha] (c - x) + z gamma) Cos[gamma]}
dp = p1[theta] - p2[gamma]

z = 36;
x = 0;
c = 1.25;
alpha = 20/180 Pi;

gr1 = ContourPlot[{dp[[1]] == 0, dp[[2]] == 0}, {theta, -Pi/4, Pi/4}, {gamma, -Pi/4, Pi/4}]


The horizontal axis represents $\theta$ and the vertical $\gamma$. In light blue is the $x$ of $\Delta p$ component and in yellow follows the $y$ of $\Delta p$ component.
The black dots representing the solutions, are obtained as follows
sol1 = FindRoot[dp == 0, {{theta, -0.15}, {gamma, -0.15}}]
sol2 = FindRoot[dp == 0, {{theta, -0.2}, {gamma, 0.2}}]
sol3 = FindRoot[dp == 0, {{theta, 0.1}, {gamma, -0.2}}]
grp1 = Graphics[{Black, PointSize[0.02], Point[{theta, gamma} /. sol1]}];
grp2 = Graphics[{Black, PointSize[0.02], Point[{theta, gamma} /. sol2]}];
grp3 = Graphics[{Black, PointSize[0.02], Point[{theta, gamma} /. sol3]}];
Show[gr1, grp1, grp2, grp3]

The guess to fire the iterative procedure to find the solutions is extracted from the graph. The same method can be applied to typical values for x,c, alpha.
