ossama-othman / MaRC

MaRC - Map Reprojections and Conversions
GNU Lesser General Public License v2.1
1 stars 0 forks source link

MaRC::ViewingGeometry angle parameters are inconsistent #51

Open ossama-othman opened 6 years ago

ossama-othman commented 6 years ago

The angle units in MaRC::ViewingGeometry methods that accept an angle, such as a latitude, are not consistent. For example, the sub_observ() method expects degrees but the is_visible() method expects radians. This error prone. Angle units should be all be consistent, preferrably in radians, to minimize the need to convert while performing mapping operations.

ossama-othman commented 4 years ago

Consider using C++11 user-defined literals to transparently convert all degree values to radians in a user friendly manner, e.g.:

MaRC::ViewingGeometry vg(...);
vg.subobserv(15.67_deg, -23_deg);  // converts degrees to radians
vg.position_angle(23_rad); // no conversion to radians needed

Assuming this turns out to be useful, creation of a larger set of user-defined literals for unit types used throughout MaRC may be the better way to go.