From 4de0fc7184f74700b68f92ce2acbd54b39b4fedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=DF?= Date: Tue, 19 Jan 2010 00:33:46 +0100 Subject: Mit Sun.h erweitert. --- Sun.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Sun.h (limited to 'Sun.h') diff --git a/Sun.h b/Sun.h new file mode 100644 index 0000000..218f7fa --- /dev/null +++ b/Sun.h @@ -0,0 +1,23 @@ +#ifndef _SUN_H_ +#define _SUN_H_ + +#include + +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_ */ -- cgit v1.2.3