1 #include "csf.h" 2 #include "csfimpl.h" 3 4 /* M_PI */ 5 #include <math.h> 6 7 #ifndef M_PI 8 # define M_PI ((double)3.14159265358979323846) 9 #endif 10 11 /* put new angle 12 * RputAngle changes the angle 13 * of the map. 14 * returns new angle or -1 in case of an error. 15 * 16 * Merrno 17 * NOACCESS 18 * BAD_ANGLE 19 */ RputAngle(MAP * map,REAL8 angle)20REAL8 RputAngle( 21 MAP *map, /* map handle */ 22 REAL8 angle) /* new angle */ 23 { 24 CHECKHANDLE_GOTO(map, error); 25 if(! WRITE_ENABLE(map)) 26 { 27 M_ERROR(NOACCESS); 28 goto error; 29 } 30 if ((0.5*-M_PI) >= angle || angle >= (0.5*M_PI)) 31 { 32 M_ERROR(BAD_ANGLE); 33 goto error; 34 } 35 map->raster.angle = angle; 36 37 return(angle); 38 error: return(-1.0); 39 } 40 41 /* get new angle 42 * RgetAngle returns the angle 43 * of the map. 44 * returns angle of the map 45 */ RgetAngle(const MAP * map)46REAL8 RgetAngle( 47 const MAP *map) /* map handle */ 48 { 49 return map->raster.angle; 50 } 51