ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/mgf2inv.c
(Generate patch)

Comparing ray/src/cv/mgflib/mgf2inv.c (file contents):
Revision 1.4 by greg, Tue Dec 5 10:59:27 1995 UTC vs.
Revision 1.6 by greg, Tue Mar 18 11:05:43 1997 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include <ctype.h>
18  
19 + #include <string.h>
20 +
21   #include "parser.h"
22  
23   #include "lookup.h"
# Line 468 | Line 470 | char   **av;
470          va[1] = v2->p[1] - v1->p[1];
471          va[2] = v2->p[2] - v1->p[2];
472          length = sqrt(DOT(va,va));
473 <        angle = acos(va[1]/length);
473 >        if (va[1] >= length)
474 >                angle = 0.;
475 >        else if (va[1] <= -length)
476 >                angle = PI;
477 >        else
478 >                angle = acos(va[1]/length);
479          printf("%sTranslation { translation %13.9g %13.9g %13.9g }\n", tabs,
480                          .5*(v1->p[0]+v2->p[0]), .5*(v1->p[1]+v2->p[1]),
481                          .5*(v1->p[2]+v2->p[2]));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines