Find an angle or an orientation between two angles or orientations

  1. What do you I to achieve?
    I want a number or orientation that shows the shortest “distance” between 2 angles or orientations (Example, {0, 145, 0}, and {0, -125, 0}, like this.

    .
  2. What is the issue?
    … Well, I don’t know how to.
    .
  3. What solutions have you I so far?
    I’ve tried looking on the devforum, but most of the results I find aren’t my problem, (at least I think) or have limitations like, “only between 90 and -90”

There is a bit of reading to do, but this may help: Dot product - Wikipedia.

The formula
image
can be translated into
image

Which gives you an angle between to vectors. It is quite easy to do in 2D, but to do it in 3D you’d need to get multiple 2D angles in order to represent the rotation needed (since there is no real “angle” between a and b.

There is already a post about this.