Skip to content

Commit

Permalink
Triangulation2 (#101)
Browse files Browse the repository at this point in the history
* Non-conservative monotone integrated and non-integrated remapping schemes.

* Edits for the non-conservative monotone remapping operators.

* Fixed the denominator in BarycentricCoordinates.
  • Loading branch information
dmarsico1 authored Sep 16, 2022
1 parent ac2eda8 commit ecad04c
Show file tree
Hide file tree
Showing 9 changed files with 3,063 additions and 117 deletions.
21 changes: 21 additions & 0 deletions src/CoordTransforms.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,27 @@ inline void StereographicProjectionInv(

///////////////////////////////////////////////////////////////////////////////

inline void GnomonicProjection(
double dLonRad0,
double dLatRad0,
double dLonRad,
double dLatRad,
double & dXs,
double & dYs
) {
// Forward projection using equations (1)-(3)
// https://mathworld.wolfram.com/GnomonicProjection.html

double dK = sin(dLatRad0) * sin(dLatRad) + cos(dLatRad0) * cos(dLatRad) * cos(dLonRad - dLonRad0);

dXs = cos(dLatRad) * sin(dLonRad - dLonRad0)/dK;

dYs = (cos(dLatRad0) * sin(dLatRad) - sin(dLatRad0) * cos(dLatRad) * cos(dLonRad - dLonRad0))/dK;

}

///////////////////////////////////////////////////////////////////////////////


#endif // _COORDTRANSFORMS_H_

Loading

0 comments on commit ecad04c

Please sign in to comment.