changequote({,}) define({_TITLE_},{Varkon MBS Programmers manual}) define({_SUBTITLE_},{- angle - Function}) define({_INDEXLINK_},{index}) define({_STYLE_},{../varkonstyle.css}) include(../../include/header.inc)

angle - Function

Description

Returns the angle (0-360) between the positive X-axis and a line from X=Y=0 to a given position.

Syntax

  a:=angle(x, y);

  float a;
  float x;
  float y;

Principal parameters

x - The x coordinate.
y - The y coordinate.

Optional parameters

None.

Return value

A FLOAT value equal to the corresponding angle in degrees.

Examples

  a:=angle(1,0);  ! Equal to a:=0.0;

  a:=angle(1,1);  ! Equal to a:=45.0;

  a:=angle(0,1);  ! Equal to a:=90.0;

  a:=angle(1,-1); ! Equalto a:=-45.0;

  a:=angle(-1,1); ! Equal to a:=135.0;

Comments

angle(x,y) is basically the same thing as arctan(y/x) but angle() deals with angles larger than or equal to 90 degrees.

include(../../include/svnversion.inc) include(../../include/footer.inc)