Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

AltStyle によって変換されたページ (->オリジナル) /