-
-
Couldn't load subscription status.
- Fork 19
lengthdir_x
Returns the horizontal x-component of the vector
lengthdir_x(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
This function returns the x-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 an x coordinate from your starting position.
This function, when used with lengthdir_y, gets the position of that point on the circle to be used in code by the instance.
lengthdir_x(5,50); //return 3,213939This function returns 3.213939, so the x coordinate of that point in a distance 5 and in the dircetion 50, is x + 3,213939.
Back to number_functions