Skip to content

line_get_slope

Vašek edited this page Feb 7, 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:

image_angle = choose(0, 90, 180, 270);

This code will set an object's image_angle to one of four angles (in this case 0, 90, 180, or 270 degrees) on random when the event is called.

Back to number_functions

Clone this wiki locally