diff options
author | Constantin Riß <constantin.riss@dre.de> | 2010-01-19 00:33:46 +0100 |
---|---|---|
committer | Constantin Riß <constantin.riss@dre.de> | 2010-01-19 00:33:46 +0100 |
commit | 4de0fc7184f74700b68f92ce2acbd54b39b4fedf (patch) | |
tree | 354e7cd36a3226f728a280e48deab49263f1f4d8 /Sun.h | |
parent | 0c90985b20e3d39d6d761614f4c73e0eefc54170 (diff) | |
download | c3d-4de0fc7184f74700b68f92ce2acbd54b39b4fedf.tar c3d-4de0fc7184f74700b68f92ce2acbd54b39b4fedf.zip |
Mit Sun.h erweitert.
Diffstat (limited to 'Sun.h')
-rw-r--r-- | Sun.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +#ifndef _SUN_H_ +#define _SUN_H_ + +#include <math.h> + +class Sun +{ + public: + Sun(float latitude0): latitude(latitude0){}; + + float declination(int day) {return 23.4*sin(2*M_PI*(284+day)/365);} + float hourangle(float time) {return 15*(time-12);} + float evelationangle(int day, float time) {return asin(sin(declination(day)*M_PI/180)* + sin(latitude*M_PI/180)* + cos(hourangle(time)*M_PI/180)* + cos(declination(day)*M_PI/180)* + cos(latitude*M_PI/180)) + *180/M_PI;} + private: + float latitude; +}; + +#endif /* _SUN_H_ */ |