I have a hypothetical vehicle traveling along an arc in 3D defined by curvature ($1/r$) and the "tilt angle" - if I let my vehicle travel indefinitely, the trajectory would be a circle; by "tilt angle" I mean the angle between the plane in which lies the circle and the xy plane (I don't know if there actually is a proper name for that). I need to calculate the heading angle (projection of into xy plane) at any given point of the circle (Curvature, the distance traveled along the circle and the tilt angle are given)
In 2D, this is quite easy: $heading angle = curvature * distance$
In 3D, it gets more complicated. The angle depends obviously on curvature and distance and on tilt angle.
My first intuition was to take the formula from 2D and multiply it by $cos(tilt)$, but that does not work, because if I travel exactly quarter of the circle, the heading angle is exactly perpendicular to inital heading angle for any tilt.
My second intuition was, that for tilt angle $\pi/2$ (and $-\pi/2$) is the heading angle at $1/4$ ($3/4$) of the circle undefined as the heading angle completely disappereas if the when the vehicle travels straight up/down, which made me think maybe division by zero. For tilt angle $\pi/2$ ($-\pi/2$), the heading angle does not change, except for the two undefined points, which makes me again think multiplying by $cos(tilt)$.
Does the formula (if there is any) change significantly, if the vehicle enters the arc already at and angle? (heading angle in the xy plane, as well as up/down angle) My intuition would be that this does not matter much, because I could compute the change and add it to the initial angles, but I am not really sure.
The trick here is to forget about the circle. In the plane of the circle, we have the following diagram:
In the 2-dimensional case, $\theta$ is the change in angle that you want, and we see that indeed $\theta = \frac{d}{r}$ (with everything measured in radians). In three dimensions, we just need to adjust that:
In this diagram $\psi$ is your "tilt angle".
Consider first the triangle $ABC$. The angle at $B$ is right ($AB$ is parallel to the $y$ axis, and $BD$ is parallel to the $x$ axis, by construction), and we know the hypotenuse and one other angle. We can therefore find $BC$ to be $r\sin\theta$ and $AB$ to be $r\cos\theta$.
Now consider triangle $BCD$. The angle at $D$ is right ($BD$ is parallel to the $x$ axis, $CD$ is parallel to the $z$ axis). We again know the hypotenuse and one other angle, so we can obtain $BD = r\sin\theta\cos\psi$.
Next consider triangle $ABD$, which is where the magic is going to happen. The angle at $B$ is right, and we know two sides. Let $\alpha$ be the angle at $A$. Then we have $\tan \alpha = \frac{\sin\theta\cos\psi}{\cos\theta} = \tan\theta\cos\psi$. Pythagoras also gives $AD$ to be $s := r\sqrt{\cos^2\theta+\sin^2\theta\cos^2\psi}$.
Now, look closely at triangle $ADE$. It lies in the $xy$ plane, and is just a copy of the first diagram, with $\theta$ replaced by $\alpha$ and $r$ replaced by $s$. Thus, our change in heading is precisely $\alpha$.
To get this into your desired form, we now need only note that $\theta = \frac{d}{r}$, and so our change in heading is precisely $\arctan(\tan\theta\cos\psi) = \arctan\left(\tan\left(\frac{d}{r}\right)\cos\psi\right)$.
Note, however, that "tilt angle" is ambiguous: I've assumed that you're pitching around an axis perpendicular to the original direction of travel, but there are other equally valid interpretations that will give entirely different answers.