/src/gdal/frmts/pcraster/libcsf/setangle.c
Line | Count | Source |
1 | | #include <math.h> |
2 | | #include "csf.h" |
3 | | #include "csfimpl.h" |
4 | | |
5 | | /* global header (opt.) and setangle's prototypes "" */ |
6 | | |
7 | | |
8 | | /* headers of this app. modules called */ |
9 | | |
10 | | /***************/ |
11 | | /* EXTERNALS */ |
12 | | /***************/ |
13 | | |
14 | | /**********************/ |
15 | | /* LOCAL DECLARATIONS */ |
16 | | /**********************/ |
17 | | |
18 | | /*********************/ |
19 | | /* LOCAL DEFINITIONS */ |
20 | | /*********************/ |
21 | | |
22 | | /******************/ |
23 | | /* IMPLEMENTATION */ |
24 | | /******************/ |
25 | | |
26 | | /* Set the stuff in the header after header initialization (LIBRARY_INTERNAL) |
27 | | * Implements some common code for Mopen, Rcreate and family: |
28 | | * |
29 | | * set the map angle cosine and sin in header |
30 | | * these values are only used in the co-ordinate conversion |
31 | | * routines. And since they do a counter clockwise rotation we |
32 | | * take the sine and cosine of the negative angle. |
33 | | * |
34 | | * Copy projection field into the raster, so raster can act as an |
35 | | * independent structure for transformations. |
36 | | */ |
37 | | void CsfFinishMapInit( |
38 | | MAP *m) /* map handle */ |
39 | 2 | { |
40 | 2 | m->raster.angleCos = cos(-(m->raster.angle)); |
41 | 2 | m->raster.angleSin = sin(-(m->raster.angle)); |
42 | 2 | m->raster.projection = MgetProjection(m); |
43 | 2 | } |