Class SunCalc
java.lang.Object
org.h2gis.functions.spatial.earth.SunCalc
This class is a partial Java port of SunCalc. A BSD-licensed JavaScript library for
calculating sun position, sunlight phases (times for sunrise, sunset, dusk,
etc.), moon position and lunar phase for the given location and time, created
by Vladimir Agafonkin (@mourner) as a part of the SunCalc.net project.
- Author:
- Erwan Bocher
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.CoordinategetPosition(Date date, double lat, double lng) Returns the sun position as a coordinate with the following properties x: sun azimuth in radians (direction along the horizon, measured from south to west), e.g. 0 is south and Math.PI * 3/4 is northwest.static booleanisGeographic(double latitude, double longitude) Test if the point has valid latitude and longitude coordinates.
-
Method Details
-
getPosition
Returns the sun position as a coordinate with the following properties x: sun azimuth in radians (direction along the horizon, measured from south to west), e.g. 0 is south and Math.PI * 3/4 is northwest. y: sun altitude above the horizon in radians, e.g. 0 at the horizon and PI/2 at the zenith (straight over your head).- Parameters:
date-lat-lng-- Returns:
-
isGeographic
public static boolean isGeographic(double latitude, double longitude) Test if the point has valid latitude and longitude coordinates.- Parameters:
latitude-longitude-- Returns:
-