| 2060 | } |
| 2061 | |
| 2062 | GMT_LOCAL double gmtplot_cross_angle (struct GMT_CTRL *GMT, double lon, double lat, double dx, double dy, unsigned int type) { |
| 2063 | /* (lon,alt) is the point and we want a tangent angle there in radians */ |
| 2064 | if (gmt_M_is_geographic (GMT, GMT_IN)) { /* General case with arbitrary orientations */ |
| 2065 | double x0, y0, x1, y1; |
| 2066 | if (type == GMT_X) { /* Compute angle from d/dx */ |
| 2067 | gmt_geo_to_xy (GMT, lon - dx, lat, &x0, &y0); |
| 2068 | gmt_geo_to_xy (GMT, lon + dx, lat, &x1, &y1); |
| 2069 | } |
| 2070 | else { /* Get d/dy */ |
| 2071 | gmt_geo_to_xy (GMT, lon, ((lat - dy) < -90.0) ? -90.0 : lat - dy, &x0, &y0); |
| 2072 | gmt_geo_to_xy (GMT, lon, ((lat + dy) > 90.0) ? 90.0 : lat + dy, &x1, &y1); |
| 2073 | } |
| 2074 | return (d_atan2 (y1-y0, x1-x0)); |
| 2075 | } |
| 2076 | /* Cartesian is always x horizontal, y 90 degrees up */ |
| 2077 | return ((type == GMT_X) ? 0.0 : M_PI_2); |
| 2078 | } |
| 2079 | |
| 2080 | GMT_LOCAL void gmtplot_map_gridcross (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, double w, double e, double s, double n) { |
| 2081 | unsigned int i, j, k, nx, ny, item[2] = {GMT_GRID_UPPER, GMT_GRID_LOWER}; |
no test coverage detected