Skip to content

lengthdir_y

drewmccluskey edited this page Jan 23, 2019 · 4 revisions

lengthdir_y

Returns the vertical y-component of the vector

Syntax:

lengthdir_y(len, dir)
Argument Description
double len The length away of the point to return
double dir The direction of the point to return

Returns: double

Description:

This function returns the y-component of the given vector. Imagine a circle around your starting position and then imagine a point anywhere on that circle. This point is in a distance len from starting position and in a direction dir. This function will return the relative positon of a y coordinate from your starting position.

This function, when used with lengthdir_x, gets the position of that point on the circle to be used in code by the instance.

Example:

lengthdir_y(5,50); //return -3,830222

This function returns -3,830222, so the y coordinate of that point in a distance 5 and in the dircetion 50, is y - 3,830222.

Back to number_functions

Clone this wiki locally