+ angle = atan2(dy, dx) + M_PI_2;
+
+ if ( vik_viewport_get_drawmode ( vvp ) == VIK_VIEWPORT_DRAWMODE_UTM) {
+ VikCoord test;
+ struct LatLon ll;
+ struct UTM u;
+ gint tx, ty;
+
+ vik_viewport_screen_to_coord ( vvp, x1, y1, &test );
+ vik_coord_to_latlon ( &test, &ll );
+ ll.lat += vik_viewport_get_ympp ( vvp ) * vik_viewport_get_height ( vvp ) / 11000.0; // about 11km per degree latitude
+ a_coords_latlon_to_utm ( &ll, &u );
+ vik_coord_load_from_utm ( &test, VIK_VIEWPORT_DRAWMODE_UTM, &u );
+ vik_viewport_coord_to_screen ( vvp, &test, &tx, &ty );
+
+ baseangle = M_PI - atan2(tx-x1, ty-y1);
+ angle -= baseangle;
+ }
+