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

Comparing ray/src/cv/mgf2inv.c (file contents):
Revision 2.3 by greg, Tue May 15 15:36:33 2012 UTC vs.
Revision 2.5 by greg, Mon Nov 20 18:32:11 2023 UTC

# Line 17 | Line 17 | static const char      RCSid[] = "$Id$";
17  
18   #include <string.h>
19  
20 + #include "color.h"
21 +
22   #include "mgf_parser.h"
23  
24   #include "lookup.h"
# Line 486 | Line 488 | i_cyl(                 /* translate a cylinder description */
488          va[0] = v2->p[0] - v1->p[0];
489          va[1] = v2->p[1] - v1->p[1];
490          va[2] = v2->p[2] - v1->p[2];
491 <        length = sqrt(DOT(va,va));
492 <        if (va[1] >= length)
491 <                angle = 0.;
492 <        else if (va[1] <= -length)
493 <                angle = PI;
494 <        else
495 <                angle = acos(va[1]/length);
491 >        length = VLEN(va);
492 >        angle = Acos(va[1]/length);
493          printf("%sTranslation { translation %13.9g %13.9g %13.9g }\n", tabs,
494                          .5*(v1->p[0]+v2->p[0]), .5*(v1->p[1]+v2->p[1]),
495                          .5*(v1->p[2]+v2->p[2]));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines