Method GetAngleFromPoints
GetAngleFromPoints(float, float, float, float)
Calculates the angle, in degrees, between two points in a 2D plane, measured from the first point to the second point.
public static float GetAngleFromPoints(float x1, float y1, float x2, float y2)
Parameters
x1floatThe X-coordinate of the starting point.
y1floatThe Y-coordinate of the starting point.
x2floatThe X-coordinate of the ending point.
y2floatThe Y-coordinate of the ending point.
Returns
- float
A floating-point value representing the angle in degrees from the starting point to the ending point, in the range [0, 360).
Remarks
The angle is measured in a counterclockwise direction, with 0 degrees corresponding to the positive X-axis. This method is useful for determining direction or orientation between two points in graphical applications.