APIAny_​CalcSunOnPlaceID

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

longitude

required, longitude

latitude

required, latitude

sumTime

required, daylight saving on/off

year

required, year

month

required, month

day

required, day

hour

required, hour

minute

required, minute

second

required, second

time zone

required, time zone in minutes

north

required, north direction

sunAngXY

out, the sun angle

sunAngZ

out, the sun angle

 

Return Values

NoError
The function has completed with success.
APIERR_NOPLAN
no open project
APIERR_BADPARS
placeInfo is nullptr or 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