Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
al_fixatan2(3)		    Library Functions Manual		  al_fixatan2(3)

NAME
     al_fixatan2 - Allegro 5 API

SYNOPSIS
	    #include <allegro5/allegro.h>

	    al_fixed al_fixatan2(al_fixed y, al_fixed x)

DESCRIPTION
     This is a fixed point version of the libc atan2() routine.  It computes the
     arc tangent of y / x, but the signs of both arguments are used to determine
     the  quadrant  of the result, and x is permitted to be zero.  This function
     is useful to convert Cartesian coordinates to polar coordinates.

     Example:

	    al_fixed result;

	    /* Sets `result' to binary angle 64. */
	    result = al_fixatan2(al_itofix(1), 0);

	    /* Sets `result' to binary angle -109. */
	    result = al_fixatan2(al_itofix(-1), al_itofix(-2));

	    /* Fails the assert. */
	    result = al_fixatan2(0, 0);
	    assert(!al_get_errno());

RETURN VALUE
     Returns the arc tangent of y / x in fixed point binary format  angle,  from
     -128 to 128.  If both x and y are zero, returns zero and sets Allegro's er-
     rno to EDOM.

Allegro reference manual					  al_fixatan2(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=al_fixatan2&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help