Calculates the sun position in a given place.
GSErrCode ACAPI_Goodies (
APIAny_CalcSunOnPlaceID,
API_PlaceInfo* placeInfo,
);
Parameters
- placeInfo
-
[in/out] Parameters of the sun place.
API_PlaceInfo
longituderequired, longitude
latituderequired, latitude
sumTimerequired, daylight saving on/off
yearrequired, year
monthrequired, month
dayrequired, day
hourrequired, hour
minuterequired, minute
secondrequired, second
time zonerequired, time zone in minutes
northrequired, north direction
sunAngXYout, the sun angle
sunAngZout, the sun angle
Return Values
NoError- The function has completed with success.
APIERR_NOPLAN- no open project
APIERR_BADPARSplaceInfoisnullptror contains invalid data
For other common API errors see the API Errors document.
Remarks
This function is used get the sun angles to in a custom place. The sun angles are calculated in a given place and on a certain day and time. The calculated angles are returned in the sunAngXY and sunAngZ fields of the structure.
Refer to the APIEnv_GetPlaceSetsID function to get the actual location and date parameters.
Example
API_PlaceInfo placeInfo = {}; GSErrCode err; placeInfo.longitude = 47.497913; placeInfo.latitude = 19.040236; placeInfo.sumTime = false; /* winter time */ placeInfo.year= 2001; placeInfo.month = 11; placeInfo.day = 11; placeInfo.hour= 10; placeInfo.minute = 7; placeInfo.second = 12; placeInfo.timeZoneInMinutes = 60; placeInfo.north = PI / 2; /* up direction */ err = ACAPI_Goodies (APIAny_CalcSunOnPlaceID, &placeInfo, nullptr);
Requirements
- Version: API 4.1 or later
- Header: APIdefs_Goodies.h
See Also
API_PlaceInfo,
APIEnv_GetPlaceSetsID,
ACAPI_Goodies, API Functions