Skip to content

line_get_slope

Vašek edited this page Feb 8, 2019 · 3 revisions

line_get_slope

Returns the slope of the given line

Syntax:

line_get_slope(pos1, pos2)
Argument Description
Vector2 pos1 First position of the line
Vector2 pos2 The other position of the line

Returns: float

Description:

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:

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

Clone this wiki locally