After spending some more time with the spiral, I think the conclusion is that you will need some numerical solver to find the end points of the perpendicular line segments.
If we assume a simple spiral given by r = b\ \theta, then its parametric representation is given by:
\begin{cases}
x(\theta) = b\ \theta \cos \theta\\
y(\theta) = b\ \theta \sin \theta
\end{cases}
The perpendicular line at a point \theta_0 is described another parametric equation:
\begin{cases}
x(\theta,\theta_0) = b\ (\theta_0 \cos \theta_0 + (\sin \theta_0 + \theta_0 \cos \theta_0) (\theta - \theta_0))\\
y(\theta,\theta_0) = b\ (\theta_0 \sin\theta_0 - (\cos\theta_0 - \theta_0 \sin \theta_0) (\theta - \theta_0))
\end{cases}
The endpoint of the perpendicular lies on the spiral at some value \theta_1, so we can equate the two to find intersections:
b\ (\theta_0 \cos \theta_0 + (\sin \theta_0 + \theta_0 \cos \theta_0) (\theta - \theta_0)) = b\ \theta_1 \cos \theta_1\\
b\ (\theta_0 \sin\theta_0 - (\cos\theta_0 - \theta_0 \sin \theta_0) (\theta - \theta_0)) = b\ \theta_1 \sin \theta_1
We see that the solution is independent of b, which is expected, since it’s just a scaling factor. We are interested in finding \theta_1 for a given \theta_0. By rearranging and rewriting the first part, we get an expression for \theta that can be substituted into the second part to be simplified further.
\theta = \theta_0 + \frac{\theta_1 \cos\theta_1 - \theta_0 \cos\theta_0}{\theta_0 \cos \theta_0 + \sin\theta_0}
After inserting this into the second part and rewriting, we get:
\frac{\theta_0-\theta_1 \cos(\theta_0-\theta_1)+\theta_0\theta_1\sin(\theta_0-\theta_1)}{\theta_0\cos\theta_0+\sin\theta_0} =0
which is true if the numerator is zero
\theta_0-\theta_1 \cos(\theta_0-\theta_1)+\theta_0\theta_1\sin(\theta_0-\theta_1) =0
I don’t know of a way to express this equation in a closed form to find values for \theta_1. However, due to the way the spiral is constructed, I believe we can set the following bounds:
\theta_0 + \pi < \theta_1 < \theta_0 + 2\pi
Some numerical solver should be fairly quick in finding suitable values for \theta_1. We can then use the formula for \theta we found earlier to determine until which value we need to draw the parametric perpendicular line.
This gives me these results: