Difference between revisions of "Atan"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>atan</c> 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 quad...")
 
 
Line 15: Line 15:
 
|-
 
|-
 
| ''y'' || number, default 0 || height of the side opposite the angle
 
| ''y'' || number, default 0 || height of the side opposite the angle
 +
|-
 
| ''x'' || number, default 1 || length of the side adjacent the angle
 
| ''x'' || number, default 1 || length of the side adjacent the angle
 
|}
 
|}

Latest revision as of 22:43, 15 March 2020

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