static char *SccsId = "@(#)dig_circle.c 3.1 (TU-Delft) 03/03/87";
/**********************************************************

Name/Version      : DIMCHECK/3.1

Language          : C
Operating system  : UNIX SYSTEM V
Host machine      : HP9000

Author(s)	  : T.G.R. van Leuken, J.T. Fokkema
Creation date	  : 15-Jun-1982
Modified by       : J. Liedorp
Modification date : 14-Oct-1986


        Delft University of Technology
        Department of Electrical Engineering
        Network Theory Section
        Mekelweg 4 - P.O.Box 5031
        2600 GA DELFT
        The Netherlands

        Phone : 015 - 786234

        COPYRIGHT (C) 1984 , All rights reserved
**********************************************************/
#include "dimcheck.h"

/* This procedure returns the value of the square root	 */
/* of length*length - dx*dx making use of the table made */
/* by ini().						 */
/* If the length is greater then the dimensions of the	 */
/* table, the value is calculated via a square root.	 */

dig_circle (length, dx)
int     length,
        dx;
{
    if (dx >= length)
	return (0);
    if (length > MAXGAPTABLE || dx > MAXGAPTABLE)
        return((int) (sqrt((double) (length * length) -
                           (double) (dx * dx) + 0.99999)));
    return (ptable[length].dis[dx]);
}

