I would like to know how to get the angle on the picture when the origin is not O(0,0,0), but (a, b, c) where a, b, and c are variables.
B is a point that makes 90 degrees with A(d, e, f) and the origin.
The image is here:

I would like to know how to get the angle on the picture when the origin is not O(0,0,0), but (a, b, c) where a, b, and c are variables.
B is a point that makes 90 degrees with A(d, e, f) and the origin.
The image is here:

First, subtract the origin from A and B:
Then, normalize the vectors:
Then find the dot product of A and B:
Then find the inverse cosine. This is your angle:
(Note that the result is in radians. To convert to degrees, multiply by 180 and divide by π.)
Here is C++ source code that uses GLM to implement this method: