--- ray/src/common/fvect.h 2012/09/06 00:07:43 2.14 +++ ray/src/common/fvect.h 2014/12/04 05:26:27 2.17 @@ -1,4 +1,4 @@ -/* RCSid $Id: fvect.h,v 2.14 2012/09/06 00:07:43 greg Exp $ */ +/* RCSid $Id: fvect.h,v 2.17 2014/12/04 05:26:27 greg Exp $ */ /* * Declarations for floating-point vector operations. */ @@ -11,9 +11,11 @@ extern "C" { #ifdef SMLFLT #define RREAL float #define FTINY (1e-3) +#define FVFORMAT "%f %f %f" #else #define RREAL double #define FTINY (1e-6) +#define FVFORMAT "%lf %lf %lf" #endif #define FHUGE (1e10) @@ -40,6 +42,8 @@ typedef RREAL FVECT[3]; #define GEOD_ABS 1 /* absolute geodesic distance */ #define GEOD_REL 2 /* relative geodesic distance */ +extern double Acos(double x); +extern double Asin(double x); extern double fdot(const FVECT v1, const FVECT v2); extern double dist2(const FVECT v1, const FVECT v2); extern double dist2line(const FVECT p, const FVECT ep1, const FVECT ep2); @@ -47,6 +51,7 @@ extern double dist2lseg(const FVECT p, const FVECT ep1 extern void fcross(FVECT vres, const FVECT v1, const FVECT v2); extern void fvsum(FVECT vres, const FVECT v0, const FVECT v1, double f); extern double normalize(FVECT v); +extern int getperpendicular(FVECT vp, const FVECT v); extern int closestapproach(RREAL t[2], const FVECT rorg0, const FVECT rdir0, const FVECT rorg1, const FVECT rdir1);