Hello, how can I program the same formula attached, converted from Comau Robots with language Inform?
Calculates the arc tangent of a quotient
-
Paolo -
April 24, 2014 at 9:39 AM -
Thread is marked as Resolved.
-
-
How about the ATAN instruction? The only issue is that it does not take the quadrants into account, so you have to correct the result for the quadrant the point is in. You could create a job for that with 2 arguments and a return variable.
Example:
LB000 = quadrant (calculated from sign of x and y)
LD000 = x
LD001 = yIFTHEN LD000=0
IFTHEN LD001>=0
SET LR001 90
ELSE
SET LR001 -90
ENDIF
ELSE
SET LR000 EXPRESS LD001 / LD000
ATAN LR001 LR000
ENDIF
'
'Correct angle for each quadrant
IFTHEN LB000=2
SET LR001 EXPRESS 180 + LR001
ELSEIF LB000=3
SET LR001 EXPRESS -180 + LR001
ENDIF -
Ok, once you got the corner, how can I change, for example, a Rx of user frames automatically?