arc.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
* All Rights Reserved.
*/
#include "hp7221.h"
/*
* 7221 requires knowing the anlge of arc. To do this, the triangle formula
* c^2 = a^2 + b^2 - 2*a*b*cos(angle)
* is used where "a" and "b" are the radius of the circle and "c" is the
* distance between the beginning point and the end point.
*
* This gives us "angle" or angle - 180. To find out which, draw a line from
* beg to center. This splits the plane in half. All points on one side of the
* plane will have the same sign when plugged into the equation for the line.
* Pick a point on the "right side" of the line (see program below). If "end"
* has the same sign as this point does, then they are both on the same side
* of the line and so angle is < 180. Otherwise, angle > 180.
*/
{
double a,b,c;
int angle;
/* Probably should check that this is really a circular arc. */
angle += 180;
/* Not quite implemented...
printf("C(A%d c)[%d,%d]", angle, xbeg, ybeg);
*/
}