Seiki Batch Script > Mathematical Functions

@atan2

Returns the angle whose tangent is the quotient of two specified floating point numbers

Class: Mathematical

Parameters:  @y – A number representing the y co-ordinate of a point

                     @x – A number representing the x co-ordinate of a point

Syntax: @returnValue=@atan2(@y, @x)

Returns: An angle, Θ, measured in radians

Remarks:

•      The return value is the angle in the Cartesian plane formed by the x-axis, and a vector starting from the origin (0,0), and terminating at the point (@x,@y).

•      Multiply the return value by 180/∏ to convert from radians to degrees

•      Used in preference to @atan when the adjacent is very small

Example:

//Example for the mathematical @atan2 method

@x=1 //Set x co-ordinate value

@y=2 //Set y co-ordinate value

@result_rad=@atan2(@y, @x) //Calculate result in radians (= 1.10715)

@result_deg=@result_rad*(180/@pi()) //Convert radians to degrees (= 63.4349)

message(“Angle in radians is “ + @result_rad + “ and in degrees is “ + @result_deg) //Display results message