Table of Contents

Method GetAngleFromPoints

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

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

x1 float

The X-coordinate of the starting point.

y1 float

The Y-coordinate of the starting point.

x2 float

The X-coordinate of the ending point.

y2 float

The 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.