-
-
Notifications
You must be signed in to change notification settings - Fork 18
line_get_slope
Vašek edited this page Feb 8, 2019
·
3 revisions
Returns the slope of the given line
line_get_slope(pos1, pos2)
Argument | Description |
---|---|
Vector2 pos1 |
First position of the line |
Vector2 pos2 |
The other position of the line |
Returns: float
A slope is a number that describes steepness of the line. The slope is calculated by dividing the difference in y-coordinates by the difference in x-coordinates. For example:
float value = line_get_slope(new Vector2(16, 16), new Vector2(32, 32));
This code will set value
to 1.
Back to number_functions