#ifndef PRIMITIVE_PXX_INCLUDED #define PRIMITIVE_PXX_INCLUDED #define NEW_ANGLE(a) { \ int quot = (int) (a/(2.*Standard_PI)); \ if (Abs(quot) >= 1) a = a - 2.*Standard_PI*quot; \ } #define REALEPSILON() (0.0001) #define VALUE_OF_ANGLE(x,y,z) { \ double a; \ if (x > 0.) \ if (x <= REALEPSILON ()) x = 0.; \ if (x < 0.) \ if (-x <= REALEPSILON ()) x = 0.; \ if (y > 0.) \ if (y <= REALEPSILON ()) y = 0.; \ if (y < 0.) \ if (-y <= REALEPSILON ()) y = 0.; \ if (x == 0.) { \ if (y > 0.) z = Standard_PI/2.; \ else z = - Standard_PI/2.; \ } \ if (y == 0.) { \ if (x > 0.) z = 0.; \ else z = Standard_PI; \ } \ if ((x < 0.) && (y > 0.)) { \ a = acos (x); \ if ((a >= Standard_PI/2.-REALEPSILON ()) && \ (a <= Standard_PI+REALEPSILON ())) \ z = a; \ else \ z = - a; \ } \ if ((x >= 0.) && (y > 0.)) { \ a = acos (x); \ if ((a >= 0.) && \ (a <= Standard_PI/2.+REALEPSILON ())) \ z = a; \ else \ z = - a; \ } \ if ((x < 0.) && (y < 0.)) { \ a = acos (x); \ z = - a; \ } \ if ((x > 0.) && (y < 0.)) { \ a = acos (x); \ if ((a >= 0.) && \ (a <= Standard_PI/2.+REALEPSILON ())) \ z = - a; \ else \ z = a; \ } \ } #define XROTATE(x,y) ((x)*cosa - (y)*sina) #define YROTATE(x,y) ((y)*cosa + (x)*sina) #endif