Isis 3 Programmer Reference
Lambert.cpp
1 #include <cmath>
2 #include "Lambert.h"
3 
4 namespace Isis {
5  double Lambert::PhotoModelAlgorithm(double phase, double incidence,
6  double emission) {
7  static double pht_lambert;
8  double incrad;
9  double munot;
10 
11  static double old_phase = -9999;
12  static double old_incidence = -9999;
13  static double old_emission= -9999;
14 
15  if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
16  return pht_lambert;
17  }
18 
19  old_phase = phase;
20  old_incidence = incidence;
21  old_emission = emission;
22 
23  incrad = incidence * Isis::PI / 180.0;
24  munot = cos(incrad);
25 
26  if(munot <= 0.0 || incidence == 90.0) {
27  pht_lambert = 0.0;
28  }
29  else {
30  pht_lambert = munot;
31  }
32 
33  return pht_lambert;
34  }
35 }
36 
37 extern "C" Isis::PhotoModel *LambertPlugin(Isis::Pvl &pvl) {
38  return new Isis::Lambert(pvl);
39 }
const double PI
The mathematical constant PI.
Definition: Constants.h:56
Container for cube-like labels.
Definition: Pvl.h:135
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31