Atan

From MiniScript Wiki
Jump to navigation Jump to search

atan is a function that returns the arctangent of a value or ratio, that is, the angle (in radians) whose tangent is y/x. This will return an angle in the correct quadrant, taking into account the sign of both arguments. The second argument is optional, and if omitted, this function is equivalent to the traditional one-parameter atan function. Note that the parameters are in y,x order.


Arguments

Parameter Name Default Value Meaning
y number, default 0 height of the side opposite the angle
x number, default 1 length of the side adjacent the angle

Example

atan(1, -1)   // returns 2.356194