ossama-othman / MaRC

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

Fold viewing geometry sub-observation longitude shift into rotation matrix calculation #53

Open ossama-othman opened 6 years ago

ossama-othman commented 6 years ago

When converting between body and observer (camera) coordinates in viewing geometry related code, longitudes are shifted to take into account the sub-observation longitude. For example, the following code exists in MaRC::ViewingGeometry::latlon2pix():

    if (this->body_->prograde())
        lon  = this->sub_observ_lon_ - lon;
    else
        lon -= this->sub_observ_lon_;

Since this is basically just a rotation about the Z-axis, it should be possible incorporate this rotation in to the rotation matrices used when converting between body and observer coordinates. Doing so would further simplify such lat/lon-pixel conversion code.