Canoe
Comprehensive Atmosphere N' Ocean Engine
planets.cpp
Go to the documentation of this file.
1 
9 // climath headers
10 #include <climath/core.h>
11 
12 #include <cmath>
13 
14 // harp2 headers
15 #include "planets.hpp"
16 
17 double centric2graphic(double clat_deg, double rerp) {
18  if (std::abs(clat_deg) == 90.)
19  return clat_deg;
20  else
21  return rad2deg(atan(tan(deg2rad(clat_deg)) * (rerp * rerp)));
22 }
23 
24 double graphic2centric(double glat_deg, double rerp) {
25  if (std::abs(glat_deg) == 90.)
26  return glat_deg;
27  else
28  return rad2deg(atan(tan(deg2rad(glat_deg)) / (rerp * rerp)));
29 }
30 
31 double jup_graphic2centric(double glat_deg) {
32  double jup_rerp = 1.07;
33  return graphic2centric(glat_deg, jup_rerp);
34 }
35 
36 double jup_centric2graphic(double clat_deg) {
37  double jup_rerp = 1.07;
38  return centric2graphic(clat_deg, jup_rerp);
39 }
double deg2rad(double phi)
Definition: core.h:41
double rad2deg(double phi)
Definition: core.h:40
double centric2graphic(double clat_deg, double rerp)
planetocentric latitude to planetographic latitude
Definition: planets.cpp:17
double jup_centric2graphic(double clat_deg)
planetocentric latitude to planetographic latitude for Jupiter
Definition: planets.cpp:36
double graphic2centric(double glat_deg, double rerp)
planetographic latitude to planetocentric latitude
Definition: planets.cpp:24
double jup_graphic2centric(double glat_deg)
planetographic latitude to planetocentric latitude for Jupiter
Definition: planets.cpp:31