# 2.11BSD#431 - /usr/src/usr.lib/libplot/hp2648/circle.c

##### Functions

    circle            X

       1: /*
       2:  * Copyright (c) 1980 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifndef lint
       8: static char sccsid[] = "@(#)circle.c	5.1 (Berkeley) 5/7/85";
       9: #endif not lint
      10:
      11: #include "hp2648.h"
      12:
      13: circle (xc,yc,r)
      14: int xc,yc,r;
      15: {
      16:     double costheta,sintheta,x,y,xn;
      17:     int xi,yi;
      18:
      19:     if(r<1){
      20:         point(xc,yc);
      21:         return;
      22:     }
      23:     sintheta = 1.0/r;
      24:     costheta = pow(1-sintheta*sintheta,0.5);
      25:     xi = x = r;
      26:     yi = y = 0;
      27:     do {
      28:         point(xc+xi,yc+yi);
      29:         xn = x;
      30:         xi = x = x*costheta + y*sintheta;
      31:         yi = y = y*costheta - xn*sintheta;
      32:     } while( ! (yi==0 && xi >= r-1));
      33: }

#### Defined functions

circle defined in line 13; never used

#### Defined variables

sccsid defined in line 8; never used

Last modified: 1987-02-18 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 733 |