Given a spherical coordinate system that gives you a point (ρ, θ, φ), its quite easy to find an (x, y, z) 3D point.
My issue is that I don't really have a φ angle to use, as my secondary angle is offset from the center of the sphere.
I have a horizontal angle (0 ≤ horizontal < 360), a vertical angle (0 ≤ horizontal < 360), and a distance > 0. The vertical angle is offset from the center of the sphere on the XY plane. Getting ρ is easy as that is just the Pythagorean theorem. θ is given to us by the Horizontal Angle. The problem is that φ isn't given as the vertical angle is offset from the center. One thing to note is that the initial distance that is found always tangent to the radius (offset line). The vertical angle rotates around the circle created by this radius.
Given the information I have, is there a way to find what φ is at any given vertical angle used? I could not find any formula for this kind of offset sphere.
Any help and input on this would be awesome!
Using a 2-d coordinate system as an example, let's define the Cartesian coordinates of the circles as:
$$(x+r_{offset}\cos(\theta))^2 + (y + r_{offset}\sin(\theta))^2 = r_{1}^2$$
$$x^2 +y^2 = r_{2} ^2$$
Evaluating a point as a point rotates around the circumference of $r_1$ with an angle $\lambda$ (with respect to the $r_1$ origin), we can determine the corresponding angle $\varphi$ with its origin at the center of $r_2$ as: $$\tan(\varphi) = \frac {r_1 \sin(\lambda)}{r_{offset}+r_1 \cos(\lambda)}, $$
thus: $$\varphi = \tan^{-1} \left( \frac {r_1 \sin(\lambda)}{r_{offset}+r_1 \cos(\lambda)}\right). $$
This should also translate to 3-dimensional coordinates, hope it helps anybody that wonders in here.