X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fsonar.c;h=3a8cf468cf668f1ac8b4f0a709a89120bfc5bdf0;hp=7d965b50745886021b4f18b770de752cf265166d;hb=c596d1306f5f92f7eab76224d3b049980a14adcb;hpb=5832fe184606766fef23369159306c0a5799aeb0 diff --git a/hacks/sonar.c b/hacks/sonar.c index 7d965b50..3a8cf468 100644 --- a/hacks/sonar.c +++ b/hacks/sonar.c @@ -37,7 +37,7 @@ * software for any purpose. It is provided "as is" without express or * implied warranty. * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * * Version 1.0 April 27, 1998. * - Initial version @@ -1486,7 +1486,8 @@ DrawBogie(sonar_info *si, int draw, char *name, int degrees, /* Compute the coordinates of the object */ - distance = (log((double) distance) / 10.0) * si->radius; + if (distance != 0) + distance = (log((double) distance) / 10.0) * si->radius; x = ox + ((double) distance * cos(4.0 * ((double) degrees)/57.29578)); y = oy - ((double) distance * sin(4.0 * ((double) degrees)/57.29578));