1 #include <iostream> 2 #include <vector> 3 #ifdef _MSC_VER 4 # include "vcl_msvc_warnings.h" 5 #endif 6 #include "vnl/vnl_math.h" 7 #include "vgl/vgl_vector_3d.h" 8 #include "boxm2_normal_albedo_array.h" 9 get_normals()10std::vector<vgl_vector_3d<double> > boxm2_normal_albedo_array::get_normals() 11 { 12 std::vector<vgl_vector_3d<double> > normals; 13 normals.emplace_back(0.0, 0.0, 1.0); 14 unsigned int num_az[] = {8,7}; 15 for (unsigned int e=0; e<2; ++e) { 16 for (unsigned int a=0; a<num_az[e]; ++a) { 17 double azimuth = a*vnl_math::twopi/num_az[e]; 18 double elevation = e*vnl_math::pi_over_2/2; 19 double x = std::sin(azimuth)*std::cos(elevation); 20 double y = std::cos(azimuth)*std::cos(elevation); 21 double z = std::sin(elevation); 22 normals.emplace_back(x,y,z); 23 } 24 } 25 return normals; 26 } 27