Please forgive my limited vocabulary, I'm not a math guru (yet) but I'm trying to solve a practical real-life challenge in a 3D scene I'm creating with PovRay.
Given a line going through x=0,y=0,z=0 in 3D Cartesian space. I know the angles the line has on the xz plane and the yz plane as they would be when viewing them orthographically. I want to know the angle that the line makes towards the z axis.
I came up with some known points, and an assumption:
- When xz=90° and yz=90° then the angle should be 0° (or 180° or 360°).
- When xz=0° and yz=0° then the angle should be 90° (or 270°).
- When xz=-90° and yz=-90° then the angle should be 0° again...
When xz=45° and yz=0° then the angle should be 45° etc...
My intuition says that xz=45° and yz=45° should be more than 45°. Slicing a cube from corner to opposite corner, so probably 180 - (inverse tan(0.5/1)) = 153.43°. Not sure if I have that correct though.
I could lay out the known values in a spreadsheet and try to brew a formula averaging the two angles and using a sinus or cosinus to wobble between the extremes, but I'd never know if the intermediate answers would actually be correct. Things also get tricky when x and y go different, I'm not sure where to start, summing them, taking an average or what.
At this point my brain starts running into digression mode, where I cannot concentrate or remember the last step taken... I'm not sure if it's a subconscious panic reaction but it bothers me. Seems like a barrier that prevents me from being as smart as Pythagoras was... How did he overcome that, sorry...
For now I just need a formula, but if someone could add some enlightenment (enable me to reason the formula on my own) that would be super!