# Sun position and elevation

Hello everybody!

For my Cesium App (paragliding simulator online) I am searching a way to know the precise sun position in the sky, in terms of orientation and elevation on the horizon, knowing a position on the earth and an UTC time.

I know that there are very complicated formulas to do thatâ€¦ but since Cesium Engine have the capability to draw the sun in the skyâ€¦ i thought that it had just done the â€śdirty jobâ€ť :Dâ€¦ there is a way to retrieve those informations?

Thank you!

some time ago somebody suggested to me to use this functions :
"to get the sun position use Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame and Transforms.computeTemeToPseudoFixedMatrix"

but i canâ€™t understand how exactlyâ€¦ can somebody provide me an example?

serching in the source code i found also this : â€śviewer.scene.context.uniformState.sunPositionWCâ€ťâ€¦ but similar to the other function (Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame) this returns 3 numbers than i am not able to understandâ€¦

how to get the sun position elevation in degrees?

Hello,

Cesium does indeed compute and draw the sun where it should be depending on the time. It looks like you found the function we use to do Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame. That function takes a JulianDate as the input and returns a Cartesian3 for the sunâ€™s position.

You will have to do your own calculations to figure out the orientation and elevation from a position on the earth surface.

Best,

Hannah