Xref: utzoo comp.sources.bugs:1510 comp.graphics:4440 comp.lang.postscript:1591 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!mtxinu!unisoft!uunet!mcvax!unido!tub!actisb!federico From: federico@actisb.UUCP (Federico Heinz) Newsgroups: comp.sources.bugs,comp.graphics,comp.lang.postscript Subject: Another patch for HPGL to PostScript Message-ID: <327@actisb.UUCP> Date: 10 Feb 89 11:03:37 GMT Reply-To: federico@actisb.UUCP (Federico Heinz) Organization: Actis in Berlin GmbH, W. Germany Lines: 53 Please apply this patch to the yahp2ps program I posted about a month ago. It fixes a problem computing the radius of circles when the start angle is near a square angle. --------------------------------- Cut Here -------------------------------- *** circle.alt Thu Feb 9 19:12:10 1989 --- circle.c Thu Feb 9 19:24:09 1989 *************** *** 328,340 **** Number *radius, *angle; CoordinatePair offset; ! { Number cosineOfAngle; *angle = arcTangent(offset); ! if (cosineOfAngle = cosine(*angle)) /* Watch out for cos(a) == 0!!! */ ! *radius = divNum(offset[X], cosineOfAngle); else ! *radius = offset[X] ? offset[X] : offset[Y]; if (*radius < 0) *radius = -*radius; } --- 328,347 ---- Number *radius, *angle; CoordinatePair offset; ! { ! Number Xabs, Yabs; + Xabs = abs(offset[X]); + Yabs = abs(offset[Y]); *angle = arcTangent(offset); ! if (!offset[X]) ! *radius = Yabs; ! else if (!offset[Y]) ! *radius = Xabs; ! else if (Xabs > Yabs) ! *radius = divNum(offset[X], cosine(*angle)); else ! *radius = divNum(offset[Y], sine(*angle)); if (*radius < 0) *radius = -*radius; } -------------------------- Cut Here ----------------------------------- Have fun -- Federico Heinz "I can resist anything but temptation" -- Oscar Wilde From Europe: ...!mcvax!unido!tub!actisb!federico From elsewhere: ...!uunet!pyramid!/