Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!think.com!snorkelwacker.mit.edu!stanford.edu!msi.umn.edu!umeecs!zip!spencer From: spencer@eecs.umich.edu (Spencer W. Thomas) Newsgroups: comp.graphics Subject: Re: Three-Point Arc: Algorithm Wanted Message-ID: Date: 21 Mar 91 20:37:50 GMT References: <10082@hub.ucsb.edu> Sender: news@zip.eecs.umich.edu Distribution: na Organization: University of Michigan EECS Dept Lines: 18 In-Reply-To: ye@henri.ucsb.edu's message of 20 Mar 91 22:29:48 GMT In article <10082@hub.ucsb.edu> ye@henri.ucsb.edu writes: > Given an arc that starts at point (x1,y1), passes > through point (x2,y2), and ends at point (x3,y3) > find its equivalent representation by a center point > (x0,y0), the radius R, and the sweep angle (alpha). Connect P1 and P2 with a line, connect P2 and P3 with a line. The intersection of the perpendicular bisectors of these lines is the center point (P0). R is the distance from P0 to P1. Let Vi = Pi - P0, and define Vi x Vj = (xi yj - yi xj). Then if (V1 x V2), (V2 x V3), and (V1 x V3) all have the same sign, A = acos(V1 . V3), otherwise A = 2Pi - acos(V1 . V3). (Vi . Vj is vector dot product). -- =Spencer W. Thomas EECS Dept, U of Michigan, Ann Arbor, MI 48109 spencer@eecs.umich.edu 313-936-2616 (8-6 E[SD]T M-F)