Isis 3 Programmer Reference
Lambert.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include <cmath>
8 #include "Lambert.h"
9 
10 namespace Isis {
11  double Lambert::PhotoModelAlgorithm(double phase, double incidence,
12  double emission) {
13  static double pht_lambert;
14  double incrad;
15  double munot;
16 
17  static double old_phase = -9999;
18  static double old_incidence = -9999;
19  static double old_emission= -9999;
20 
21  if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
22  return pht_lambert;
23  }
24 
25  old_phase = phase;
26  old_incidence = incidence;
27  old_emission = emission;
28 
29  incrad = incidence * Isis::PI / 180.0;
30  munot = cos(incrad);
31 
32  if(munot <= 0.0 || incidence == 90.0) {
33  pht_lambert = 0.0;
34  }
35  else {
36  pht_lambert = munot;
37  }
38 
39  return pht_lambert;
40  }
41 }
42 
43 extern "C" Isis::PhotoModel *LambertPlugin(Isis::Pvl &pvl) {
44  return new Isis::Lambert(pvl);
45 }
Isis::PhotoModel
Definition: PhotoModel.h:41
Isis::PI
const double PI
The mathematical constant PI.
Definition: Constants.h:40
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::Lambert
Definition: Lambert.h:20
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16