forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatan2.lcdoc
More file actions
40 lines (24 loc) · 1.39 KB
/
Copy pathatan2.lcdoc
File metadata and controls
40 lines (24 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Name: atan2
Type: function
Syntax: atan2(<yCoordinate>, <xCoordinate>)
Summary: <return|Returns> the arc tangent of one number divided by another, using the <sign> of both.
Introduced: 1.0
OS: mac,windows,linux,ios,android
Platforms: desktop,server,web,mobile
Example:
atan2(-1,-1) -- returns 4/3 * pi
Example:
atan2(thisNumber,thatNumber)
Parameters:
yCoordinate: A number or an expression that evaluates to a number.
xCoordinate: A number or an expression that evaluates to a number.
The result: The result of the <atan2> <function> is <return|returned> in <radian|radians>. To get this result in <degree|degrees>, use the following <custom function>:.
Returns: The <atan2> <function> <return|returns> a number between -pi and pi.
Description:
Use the <atan2> <function> to find the arc tangent of one number divided by another when <sign> is significant.
In most cases, atan2(y,x) is equal to atan(y/x). However, if both x and y are negative, the sign of x/y is positive. In this case, the atan function <return|returns> an angle in the first quadrant, but the <atan2> <function> <return|returns> an angle in the third quadrant.
function atan2InDegrees firstArg,secondArg
return atan2(firstArg,secondArg) * 180 / pi
end atan2InDegrees
References: pi (constant), sign (glossary), radian (glossary), custom function (glossary), return (glossary), degree (glossary), function (control_st)
Tags: math