org.deegree.commons.utils
Class SunInfo

java.lang.Object
  extended by org.deegree.commons.utils.SunInfo

public class SunInfo
extends Object

The SunInfo supplies methods for the calculation of the sun position at a given time and latitude. The color of the sunlight may be requested as well.

Version:
$Revision: 30119 $, $Date: 2011-03-22 10:02:35 +0100 (Tue, 22 Mar 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Constructor Summary
SunInfo()
          Constructs a sunposition at the current (local) time
SunInfo(Calendar calendar)
          Constructs a sunposition with the given Calendar
SunInfo(int year, int month, int day, int hour, int minute)
           
 
Method Summary
 float calcSunlightIntensity(float[] color, float cloudFactor)
           
 float[] calculateSunlight(double latitude)
          This method calculates the color of the sunlight for the current time and the given latitude.
 float[] getEucledianPosition(double latitude)
          Get the euclidean position of the sun.
 double getHorizontalSunPosition()
          calculates the horizontal angle of the sun depending only on hour and minute!
 double getVerticalSunposition(double latitude)
          calculates the solar altitude for given latitude, year, month, date, hour and minute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SunInfo

public SunInfo()
Constructs a sunposition at the current (local) time


SunInfo

public SunInfo(Calendar calendar)
Constructs a sunposition with the given Calendar

Parameters:
calendar - a given Calendar

SunInfo

public SunInfo(int year,
               int month,
               int day,
               int hour,
               int minute)
Parameters:
year -
month -
day -
hour -
minute -
Method Detail

getVerticalSunposition

public double getVerticalSunposition(double latitude)
calculates the solar altitude for given latitude, year, month, date, hour and minute

Parameters:
latitude - latitude of the the viewers position
Returns:
the solar altitude in radians for the given latitude

getHorizontalSunPosition

public double getHorizontalSunPosition()
calculates the horizontal angle of the sun depending only on hour and minute!

Returns:
the horizontal angle in radians

getEucledianPosition

public float[] getEucledianPosition(double latitude)
Get the euclidean position of the sun.

Parameters:
latitude -
Returns:
the euclidean position of the sun.

calculateSunlight

public float[] calculateSunlight(double latitude)
This method calculates the color of the sunlight for the current time and the given latitude. This method is taken from deegree2, the values are undocumented.

Parameters:
latitude -
Returns:
a the color of the sunlight for the given latitude.

calcSunlightIntensity

public float calcSunlightIntensity(float[] color,
                                   float cloudFactor)
Parameters:
color - to calculate the intensity for.
cloudFactor - scale factor [0,1] describing percentage of clouds covering the sun
Returns:
the intensity of the sunlight


Copyright © 2011. All Rights Reserved.