# Angle between two lines

I have a point (V1) that is not located at (0,0,0) but something else.
I have two other point in space, and also them are not located at (0,0,0) and different from the previous one (V2 and V3).

I need to find the angle between two lines: one that is passing through V1 and V2, and the other that is passing through V1 and V3.

I attached an image that is clarifying the angle i need to find the value.

How about using Dot and Cross Product of two vectors:

or instead Dot there is a Vector3.GetAngleBetweenVectors()-function:

2 Likes

Thanks a lot!
The second method (Vector3.GetAngleBetweenVectors) can work also if the origin of the two arrows is not BABYLON.Vector3.Zero()? In the example i see only two points and the angle is calculated at the zero vector, while in my case the angle is not located at the zero vector.

Let me see how the function is coded, but in general it should work regardless.

Edit: The function pretty much seems to be Dot and Cross like on car example, and from math side I don’t see a reason why angle would be different when a normal is given, that determines perspective for the angle between two vectors. But I might miss some cases here. Related code: