---
title: "SunPosition"
language: "en"
type: "Symbol"
summary: "SunPosition[] gives the position of the Sun for the current date and location. SunPosition[datespec] gives the position of the Sun for the specified date. SunPosition[locationspec] gives the positions of the Sun for the specified location. SunPosition[locationspec, datespec] gives the position of the Sun for the specified date and location. SunPosition[{{location1, date1}, {location2, date2}, ...}] gives the positions of the Sun for all specified locations on the specified dates. SunPosition[locationspec, datespec, func] uses func to determine what to return for extended locations."
keywords: 
- sun
- solar
- shadow
canonical_url: "https://reference.wolfram.com/language/ref/SunPosition.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Astronomical Computation & Data"
    link: "https://reference.wolfram.com/language/guide/AstronomicalComputationAndData.en.md"
  - 
    title: "Date & Time"
    link: "https://reference.wolfram.com/language/guide/DateAndTime.en.md"
  - 
    title: "Weather Data"
    link: "https://reference.wolfram.com/language/guide/WeatherData.en.md"
  - 
    title: "People & History"
    link: "https://reference.wolfram.com/language/guide/PeopleAndHistory.en.md"
  - 
    title: "Geodesy"
    link: "https://reference.wolfram.com/language/guide/Geodesy.en.md"
related_functions: 
  - 
    title: "DaylightQ"
    link: "https://reference.wolfram.com/language/ref/DaylightQ.en.md"
  - 
    title: "AstroPosition"
    link: "https://reference.wolfram.com/language/ref/AstroPosition.en.md"
  - 
    title: "MoonPosition"
    link: "https://reference.wolfram.com/language/ref/MoonPosition.en.md"
  - 
    title: "AstroSubpoint"
    link: "https://reference.wolfram.com/language/ref/AstroSubpoint.en.md"
  - 
    title: "StarData"
    link: "https://reference.wolfram.com/language/ref/StarData.en.md"
  - 
    title: "MoonPhase"
    link: "https://reference.wolfram.com/language/ref/MoonPhase.en.md"
  - 
    title: "SolarEclipse"
    link: "https://reference.wolfram.com/language/ref/SolarEclipse.en.md"
  - 
    title: "LunarEclipse"
    link: "https://reference.wolfram.com/language/ref/LunarEclipse.en.md"
  - 
    title: "SiderealTime"
    link: "https://reference.wolfram.com/language/ref/SiderealTime.en.md"
  - 
    title: "TideData"
    link: "https://reference.wolfram.com/language/ref/TideData.en.md"
---
# SunPosition

SunPosition[] gives the position of the Sun for the current date and location.

SunPosition[datespec] gives the position of the Sun for the specified date.

SunPosition[locationspec] gives the positions of the Sun for the specified location.

SunPosition[locationspec, datespec] gives the position of the Sun for the specified date and location.

SunPosition[{{location1, date1}, {location2, date2}, …}] gives the positions of the Sun for all specified locations on the specified dates.

SunPosition[locationspec, datespec, func] uses func to determine what to return for extended locations.

## Details and Options

* ``SunPosition`` returns the coordinates of the Sun on the celestial sphere as observed on any date from any location on Earth.

* The default form of the results is in the form ``{azimuth, altitude}``.

* The observation location can be any point on the surface of a body in the solar system, defining the local horizon.

* Locations can be specified as ``Entity`` objects, assuming they represent objects with geographic coordinates, or they can be latitude/longitude pairs, assuming degrees as units.

* ``SunPosition[]`` makes use of ``\$GeoLocation`` and ``\$TimeZone`` to determine your location and time zone.

* ``datespec`` can be a ``DateObject`` expression, a ``TimeObject`` expression, a date string or a ``{y, m, d, h, m, s}`` date list.

* ``datespec`` is assumed to be in ``\$TimeZone``, unless it is a ``DateObject`` or ``TimeObject`` expression with an explicit ``TimeZone`` option value.

* ``locationspec`` and ``datespec`` can be either individual items or lists of individual items.

* If ``datespec`` is a list of dates, then the results will contain ``TimeSeries`` objects.

* ``datespec`` can be specified as ``{start, end, increment}`` for compatibility with ``DateRange`` specifications.

* ``SunPosition[…, func]`` is used to specify the format of output when locations are specified.

* Possible settings for ``func`` include:

|                   |                                                   |
| ----------------- | ------------------------------------------------- |
| Automatic         | returns intervals for extended locations only     |
| Interval          | returns intervals for all specified locations     |
| Mean              | returns mean value for extended locations         |
| Min               | returns minimum values for extended locations     |
| Max               | returns maximum values for extended locations     |
| StandardDeviation | returns standard deviation for extended locations |

* ``SunPosition[CelestialSystem -> "Equatorial"]`` gives the right ascension and declination of the Sun.

* ``SunPosition`` can accept the following options:

|                  |                    |                                                                             |
| ---------------- | ------------------ | --------------------------------------------------------------------------- |
| AltitudeMethod   | "ApparentAltitude" | whether to take atmospheric refraction into account when computing altitude |
| CelestialSystem  | "Horizon"          | whether to return azimuth/altitude or right ascension/declination           |

* Possible settings for ``CelestialSystem`` include:

|     |     |
| --- | --- |
| "Horizon" | returns results as a pair of azimuth/altitude (az/alt) values |
| "Equatorial" | returns results as a pair of right ascension/declination ($\alpha$ / $\delta$) values |

[image]

* Possible settings for ``AltitudeMethod`` include:

|                    |                                                                    |
| ------------------ | ------------------------------------------------------------------ |
| "ApparentAltitude" | take atmospheric refraction into account for altitude computations |
| "TrueAltitude"     | assume no atmospheric refraction for altitude computations         |

## Examples (33)

### Basic Examples (5)

Compute the current position of the Sun for your location:

```wl
In[1]:= SunPosition[]

Out[1]= {Quantity[128.65723329589503, "AngularDegrees"], Quantity[48.40932633710197, "AngularDegrees"]}
```

---

Compute the position of the Sun for a specified date:

```wl
In[1]:= SunPosition[DateObject[{2023, 3, 20, 11, 0}, TimeZone -> -6]]

Out[1]= {Quantity[157.30033791959437, "AngularDegrees"], Quantity[47.537254408542, "AngularDegrees"]}
```

---

Compute the current position of the Sun for a specified location:

```wl
In[1]:= SunPosition[\[FreeformPrompt]["Chicago"]]

Out[1]= {Quantity[130.79961009891412, "AngularDegrees"], Quantity[47.62998156387533, "AngularDegrees"]}
```

---

Compute the position of the Sun for a specified latitude/longitude and date:

```wl
In[1]:= SunPosition[GeoPosition[{50.3, -80.1}], DateObject[{2023, 10, 1, 11, 0}, "Minute", "Gregorian", -6.]]

Out[1]= {Quantity[176.87920556486108, "AngularDegrees"], Quantity[36.40032610129442, "AngularDegrees"]}
```

---

Compute the position of the Sun for a specified city and date:

```wl
In[1]:= SunPosition[\[FreeformPrompt]["Saint Louis"], DateObject[{2023, 10, 1, 11, 0}, "Minute", "Gregorian", -6.]]

Out[1]= {Quantity[161.4692407575118, "AngularDegrees"], Quantity[46.50044301982522, "AngularDegrees"]}
```

### Scope (10)

#### Dates (3)

Dates can be specified as a ``DateObject`` :

```wl
In[1]:= SunPosition[DateObject[{2013, 9, 23, 15, 0}, TimeZone -> -6]]

Out[1]= {Quantity[240.2061399368134, "AngularDegrees"], Quantity[30.033615749795967, "AngularDegrees"]}
```

---

Dates can be specified as a date string:

```wl
In[1]:= SunPosition["September 23, 2010 3:00PM CST"]

Out[1]= {Quantity[240.2617406259658, "AngularDegrees"], Quantity[30.130418551729353, "AngularDegrees"]}
```

---

Generate the Sun's position for a range of dates:

```wl
In[1]:= SunPosition[DateRange[DateObject[{2013, 1, 1, 9, 0}, "Minute", "Gregorian", -6.], DateObject[{2013, 12, 31, 9, 0}, "Minute", "Gregorian", -6.], 10]]

Out[1]=
TemporalData[TimeSeries, 
 {{QuantityArray[StructuredArray`StructuredData[{37, 2}, 
     {CompressedData["«884»"]\
, "AngularDegrees", {{1}, {2}}}]]}, {TemporalData`DateSpecification[{2013, 1, 1, 10, 0, 0.}, 
    {2013, 12, 27, 10, 0, 0.}, {10, "Day"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 2, 
  {ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 2}}, True, 
 13.3]
```

#### Locations (7)

Locations can be latitude/longitude pairs:

```wl
In[1]:= SunPosition[GeoPosition[{40.1, -88.2}]]

Out[1]= {Quantity[128.82997537330672, "AngularDegrees"], Quantity[48.50713505742411, "AngularDegrees"]}
```

---

Cities are treated as single, specific locations:

```wl
In[1]:= SunPosition[\[FreeformPrompt]["St. Louis"]]

Out[1]= {Quantity[125.15277245668271, "AngularDegrees"], Quantity[48.125968484784025, "AngularDegrees"]}
```

---

Results for extended locations are intervals by default:

```wl
In[1]:= SunPosition[\[FreeformPrompt]["France"]]

Out[1]= {Quantity[Interval[{244.44960766620935, 261.2112037378329}], "AngularDegrees"], Quantity[Interval[{22.24801299091349, 34.49706136762333}], "AngularDegrees"]}
```

---

The form of the results for extended locations can be overridden:

```wl
In[1]:= SunPosition[\[FreeformPrompt]["France"], Mean]

Out[1]= {Quantity[253.24714809954497, "AngularDegrees"], Quantity[27.88998109583008, "AngularDegrees"]}
```

---

Locations can also be off Earth:

```wl
In[1]:= SunPosition[Entity["SolarSystemFeature", "OlympusMonsMars"]]

Out[1]= {Quantity[306.6322001393942, "AngularDegrees"], Quantity[-29.953644131098216, "AngularDegrees"]}
```

---

Find the Sun's position for multiple locations:

```wl
In[1]:= SunPosition[{\[FreeformPrompt]["Chicago"], \[FreeformPrompt]["St. Louis"]}]

Out[1]= {{Quantity[130.93962856067716, "AngularDegrees"], Quantity[47.695729515643286, "AngularDegrees"]}, {Quantity[125.15665768328422, "AngularDegrees"], Quantity[48.128175839464944, "AngularDegrees"]}}
```

---

Find the Sun's position for multiple locations on different dates:

```wl
In[1]:= SunPosition[{{Entity["City", {"Chicago", "Illinois", "UnitedStates"}], DateObject[{2025, 1, 1, 12}, TimeZone -> "America/Chicago"]}, {Entity["City", {"Moscow", "Moscow", "Russia"}], DateObject[{2023, 7, 28, 6}, TimeZone -> "Europe/Moscow"]}}]

Out[1]= {{Quantity[181.39402252799792, "AngularDegrees"], Quantity[25.247345884836744, "AngularDegrees"]}, {Quantity[71.83429268400955, "AngularDegrees"], Quantity[10.826176316219469, "AngularDegrees"]}}
```

### Options (2)

#### CelestialSystem (1)

Find the right ascension and declination of the Sun for your location:

```wl
In[1]:= SunPosition[CelestialSystem -> "Equatorial"]

Out[1]= {Quantity[1.508850160331233, "HoursOfRightAscension"], Quantity[9.469787057958454, "AngularDegrees"]}
```

#### AltitudeMethod (1)

The default setting for ``AltitudeMethod`` simulates atmospheric refraction:

```wl
In[1]:= SunPosition[\[FreeformPrompt]["Champaign"], DateObject[{2022, 9, 4, 19, 5}, TimeZone -> -5]]

Out[1]= {Quantity[277.36509035334313, "AngularDegrees"], Quantity[2.238992101495479, "AngularDegrees"]}
```

Allow for no atmospheric refraction when computing the altitude of the Sun:

```wl
In[2]:= SunPosition[\[FreeformPrompt]["Champaign"], DateObject[{2022, 9, 4, 19, 5}, TimeZone -> -5], AltitudeMethod -> "TrueAltitude"]

Out[2]= {Quantity[277.36509035334313, "AngularDegrees"], Quantity[1.9590699045518514, "AngularDegrees"]}
```

### Applications (2)

Plot the equation of time by finding the difference between the Sun's right ascension at noon and the sidereal time at noon:

```wl
In[1]:= sunpos = SunPosition[GeoPosition[{0, 0}], DateRange[DateObject[{2022, 1, 1, 12, 0}, "Minute", "Gregorian", 0.], DateObject[{2022, 12, 31, 12, 0}, "Minute", "Gregorian", 0.], 10], CelestialSystem -> "Equatorial"];

In[2]:= stime = SiderealTime[GeoPosition[{0, 0}], DateRange[DateObject[{2022, 1, 1, 12, 0}, "Minute", "Gregorian", 0.], DateObject[{2022, 12, 31, 12, 0}, "Minute", "Gregorian", 0.], 10]];

In[3]:=
equationoftime = TimeSeriesThread[With[{diff = First[#][[1]] - Last[#]}, 
	UnitConvert[Mod[diff, Quantity[24, "HoursOfRightAscension"], Quantity[-12, "HoursOfRightAscension"]], "MinutesOfRightAscension"]]&, {sunpos, stime}];

In[4]:= DateListPlot[equationoftime, FrameLabel -> Automatic]

Out[4]= [image]
```

---

Determine your final location if you walk toward the Sun from sunrise to sunset at a constant speed:

```wl
In[1]:=
location = EntityValue[\[FreeformPrompt]["White House"], "Position"];
speed = Quantity[4, "Miles" / "Hours"];
deltaT = Quantity[10, "Minutes"];
start = Sunrise[location, DateObject[{2022, 7, 4}, TimeZone -> -5]];
end = Sunset[location, DateObject[{2022, 7, 4}, TimeZone -> -5]];
```

Iterate the bearing in 10-minute increments to obtain a new course and destination:

```wl
In[2]:= locs = Table[location = GeoDestination[location, {speed deltaT, SunPosition[location, DateObject[time]][[1]]}], {time, AbsoluteTime[start], AbsoluteTime[end], QuantityMagnitude[UnitConvert[Quantity[10, "Minutes"], "Seconds"]]}];
```

Visualize the resulting path:

```wl
In[3]:= GeoGraphics[{Line[locs]}]

Out[3]= [image]
```

Find the distance between the starting and ending points:

```wl
In[4]:= GeoDistance[locs[[-1]], locs[[1]]]

Out[4]= Quantity[7.3570913177529444, "Miles"]
```

### Properties & Relations (11)

By default, location is specified by ``\$GeoLocation`` and the date is specified by the current date:

```wl
In[1]:= SunPosition[]

Out[1]= {Quantity[129.20389825293228, "AngularDegrees"], Quantity[48.683519681011624, "AngularDegrees"]}

In[2]:= SunPosition[$GeoLocation, DateObject[]]

Out[2]= {Quantity[129.20409659663795, "AngularDegrees"], Quantity[48.6836182952724, "AngularDegrees"]}
```

---

Results are in the form of a ``TimeSeries`` when a range of dates is specified:

```wl
In[1]:= SunPosition[DateRange[DateObject[{2013, 1, 1, 9, 0}, TimeZone -> -6], DateObject[{2013, 12, 31, 9, 0}, TimeZone -> -6], 10]]

Out[1]=
TemporalData[TimeSeries, 
 {{QuantityArray[StructuredArray`StructuredData[{37, 2}, 
     {CompressedData["«884»"]\
, "AngularDegrees", {{1}, {2}}}]]}, {TemporalData`DateSpecification[{2013, 1, 1, 10, 0, 0.}, 
    {2013, 12, 27, 10, 0, 0.}, {10, "Day"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 2, 
  {ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 2}}, True, 
 13.3]
```

---

Results are multivalued for each date specification so plotting the results using ``DateListPlot`` will result in two curves, one for azimuth and one for altitude:

```wl
In[1]:= DateListPlot[SunPosition[DateRange[DateObject[{2013, 1, 1, 8, 0}, TimeZone -> -6], DateObject[{2013, 1, 1, 16, 0}, TimeZone -> -6], {.5, "Hour"}]], Joined -> True]

Out[1]= [image]
```

---

Find the position of the Sun for this location and date:

```wl
In[1]:=
loc = GeoPosition[{40.11, -88.22}];
date = DateObject[{2023, 7, 16, 12, 36, 0}];

In[2]:= SunPosition[loc, date]

Out[2]= {Quantity[205.46669383803436, "AngularDegrees"], Quantity[69.62189188452756, "AngularDegrees"]}

In[3]:= UnitConvert[%, MixedUnit["ArcDMS"]]

Out[3]= {Quantity[MixedMagnitude[{205, 28, 0.0978169}], MixedUnit[{"AngularDegrees", "Arcminutes", "Arcseconds"}]], Quantity[MixedMagnitude[{69, 37, 18.8108}], MixedUnit[{"AngularDegrees", "Arcminutes", "Arcseconds"}]]}
```

This can also be computed with ``AstroPosition`` :

```wl
In[4]:= AstroPosition[Entity["Star", "Sun"], {"Horizon", loc, date}]

Out[4]=
AstroPosition[{205.46669383803436, 69.62189188452756, 1.0164070676789698}, 
 {"Horizon", "Date" -> DateObject[{2023, 7, 16, 18, 37, 9.18400000000441}, "Instant", "Gregorian", 
    0., "TT"], "Location" -> GeoPosition[{40.11, -88.22}]}, "NorthAzAlt"]
```

---

Calculate the next sunrise, defined as when the upper edge of the Sun's apparent disk touches the horizon:

```wl
In[1]:= sunrise = Sunrise[]

Out[1]= DateObject[{2023, 4, 15, 6, 14, 58.0335}, "Instant", "Gregorian", -5.]
```

Find the position of the center of the Sun at that time:

```wl
In[2]:= SunPosition[sunrise]

Out[2]= {Quantity[76.42407070116658, "AngularDegrees"], Quantity[-0.2656245839827728, "AngularDegrees"]}
```

The altitude of the Sun corresponds to its angular radius:

```wl
In[3]:= AstroPosition["Sun", {"Horizon", sunrise}]["Altitude"]

Out[3]= -0.265625
```

Eliminating atmospheric refraction effects, the true position of the Sun is revealed to be even further below the horizon at sunrise:

```wl
In[4]:= AstroPosition["Sun", {"Horizon", sunrise, "Refraction" -> None}]["Altitude"]

Out[4]= -0.887401
```

---

Generate the analemma of the Sun:

```wl
In[1]:= Graphics[{Red, Point@Map[QuantityMagnitude, SunPosition[DateRange[DateObject[{2023, 1, 1, 9, 0}, "Minute", "Gregorian", -6.], DateObject[{2023, 12, 31, 9, 0}, "Minute", "Gregorian", -6.], 10]]["Values"], {2}]}, Frame -> True]

Out[1]= [image]
```

---

Plot the position of the Sun for your location between sunrise and sunset for the solstices and equinox:

```wl
In[1]:=
summersolstice = DateObject[{2013, 6, 21}, "Day", "Gregorian", -6.];
autumnalequinox = DateObject[{2013, 9, 22}, "Day", "Gregorian", -6.];
wintersolstice = DateObject[{2013, 12, 21}, "Day", "Gregorian", -6.];coordsToCartesian = Evaluate[CoordinateTransformData["Spherical" -> "Cartesian", "Mapping", {1, π / 2 - (#2 Degree), 2Pi - (#1 Degree)}]]&;getValues = Function[{series}, Map[QuantityMagnitude, series["Values"], {2}]];getSunriseToSunset = DateRange[Sunrise[#], Sunset[#], {30, "Minute"}]&;
Graphics3D[{
	Black, Table[Text[{"W", "S", "E", "N"}[[j]], 1.1{Cos[Pi / 2 j], Sin[Pi / 2 j], 0}], {j, 4}], 
	Thickness[.007], Transpose[{Darker /@ {Red, Green, Blue}, 
	(Line@(coordsToCartesian@@@(getValues@SunPosition[getSunriseToSunset[#]])))& /@ {summersolstice, autumnalequinox, wintersolstice}}], White, Cylinder[{{0, 0, -.005}, {0, 0, 0}}], Opacity[.1], Sphere[]}, PlotRange -> {0, 1}, Boxed -> False]

Out[1]= [image]
```

---

Generate a map of Italy with the illumination set for sunrise:

```wl
In[1]:=
horizonCoordinatesToLightingAngle[{azimuth_, altitude_}] := {(2 π - QuantityMagnitude[UnitConvert[azimuth, "Radians"]] + π / 2), QuantityMagnitude[UnitConvert[altitude, "Radians"]]};
GeoGraphics[{GeoStyling["ReliefMap", LightingAngle -> horizonCoordinatesToLightingAngle[SunPosition[\[FreeformPrompt]["Rome"], Sunrise[\[FreeformPrompt]["Rome"], TimeZone -> LocalTimeZone[\[FreeformPrompt]["Rome"]]]]]], Polygon[\[FreeformPrompt]["Italy"]]}]

Out[1]= [image]
```

---

Plot the angular distance between the Sun and Moon over a month:

```wl
In[1]:= SphereDistance[{ϕ1_, θ1_}, {ϕ2_, θ2_}] := InverseHaversine[Haversine[ϕ1 - ϕ2] + Cos[ϕ1] Cos[ϕ2] Haversine[θ1 - θ2]]

In[2]:= sunposequatorial = SunPosition[DateRange[DateObject[{2014, 1, 1, 0, 0, 0}, "Instant", "Gregorian", -6.], DateObject[{2014, 2, 1, 0, 0, 0}, "Instant", "Gregorian", -6.], {1, "Day"}], CelestialSystem -> "Equatorial"];

In[3]:= moonposequatorial = MoonPosition[DateRange[DateObject[{2014, 1, 1, 0, 0, 0}, "Instant", "Gregorian", -6.], DateObject[{2014, 2, 1, 0, 0, 0}, "Instant", "Gregorian", -6.], {1, "Day"}], CelestialSystem -> "Equatorial"];

In[4]:= angdistequatorial = TimeSeriesThread[Quantity[SphereDistance[First[#], Last[#]] / Degree, "AngularDegrees"]&, {sunposequatorial, moonposequatorial}];

In[5]:= DateListPlot[angdistequatorial]

Out[5]= [image]
```

---

Plot the position of the Sun and Moon on the celestial sphere:

```wl
In[1]:=
EquatorialtoCartesian[ ra_, dec_] := Module[ {x, y, z}, 
	x = Cos[15 ra Degree] Sin[π / 2 - dec Degree];
	y = Sin[15ra Degree] Sin[π / 2 - dec Degree];
	z = Cos[π / 2 - dec Degree];
	{x, y, z} ]

In[2]:= Show[ParametricPlot3D[{Cos[t] Sin[p], Sin[t] Sin[p], Cos[p]}, {t, 0, 2 Pi}, {p, 0, Pi}, PlotStyle -> Opacity[.3]], Graphics3D[{Yellow, PointSize[.05], Point[EquatorialtoCartesian@@N@QuantityMagnitude@SunPosition[DateObject[{2017, 8, 20, 9, 0, 0}, "Instant", "Gregorian", -6.], CelestialSystem -> "Equatorial"]], Blue, Point[EquatorialtoCartesian@@N@QuantityMagnitude@MoonPosition[DateObject[{2017, 8, 20, 9, 0, 0}, "Instant", "Gregorian", -6.], CelestialSystem -> "Equatorial"]]}], SphericalRegion -> True]

Out[2]= [image]
```

---

Examine how the Sun's position changes with varying latitude and longitude:

```wl
In[1]:= varylatitude = Transpose[{Table[lat, {lat, -90, 90}], SunPosition[Table[GeoPosition[{lat, -88.2}], {lat, -90, 90}], DateObject[{2014, 2, 26, 12, 0, 0}, "Instant", "Gregorian", -6.]]}];

In[2]:= varylongitude = Transpose[{Table[long, {long, -180, 180, 2}], SunPosition[Table[GeoPosition[{40.1, long}], {long, -180, 180, 2}], DateObject[{2014, 2, 26, 12, 0, 0}, "Instant", "Gregorian", -6.]]}];

In[3]:=
Grid[{
	{
	ListPlot[{#[[1]], #[[2, 2]]}& /@ varylatitude, Frame -> True, FrameLabel -> {"latitude", "altitude"}, Joined -> True], ListPlot[{#[[1]], #[[2, 1]]}& /@ varylatitude, Frame -> True, FrameLabel -> {"latitude", "azimuth"}, Joined -> True]}, 
	{
	ListPlot[{#[[1]], #[[2, 2]]}& /@ varylongitude, Frame -> True, FrameLabel -> {"longitude", "altitude"}, Joined -> True], ListPlot[{#[[1]], #[[2, 1]]}& /@ varylongitude, Frame -> True, FrameLabel -> {"longitude", "azimuth"}, Joined -> True]}
	}]

Out[3]=
|         |         |
| ------- | ------- |
| [image] | [image] |
| [image] | [image] |
```

### Possible Issues (2)

With ``SunPosition[locationspec, Interval]``, results for specific locations are coerced into intervals:

```wl
In[1]:= SunPosition[GeoPosition[{40.1, -88.2}], Interval]

Out[1]= {Quantity[Interval[{186.77488745375226, 186.7748874537523}], "AngularDegrees"], Quantity[Interval[{42.02387846935024, 42.02387846935025}], "AngularDegrees"]}
```

---

Attempting to plot the results of ``SunPosition`` using ``"Minute"`` granularity or larger can result in artifacts:

```wl
In[1]:= Plot[SunPosition[Entity["City", {"Champaign", "Illinois", "UnitedStates"}], DatePlus[DateObject[{2023, 4, 14, 10, 29}, "Minute", TimeZone -> -5], {x, "Hour"}]][[2]], {x, 0.1, 1}]

Out[1]= [image]
```

One workaround to such issues is to coerce the incoming date so that it has ``"Instant"`` granularity:

```wl
In[2]:= Plot[SunPosition[Entity["City", {"Champaign", "Illinois", "UnitedStates"}], DatePlus[DateObject[DateObject[{2023, 4, 14, 10, 29}, "Minute", TimeZone -> -5], "Instant"], {x, "Hour"}]][[2]], {x, 0.1, 1}]

Out[2]= [image]
```

### Neat Examples (1)

Choose a location and a date:

```wl
In[1]:=
loc = GeoPosition[{40.1, -88.2}];
date = DateObject[{2022, 7, 5, 16, 0, 0}, TimeZone -> -6];
```

This is the sidereal time of that location at that time:

```wl
In[2]:= sidtime = SiderealTime[loc, date]

Out[2]= Quantity[MixedMagnitude[{11, 2, 41.9559}], MixedUnit[{"HoursOfRightAscension", "MinutesOfRightAscension", "SecondsOfRightAscension"}]]
```

Take the right ascensions of the Sun, the Moon and the planets:

```wl
In[3]:=
sunRA = First[SunPosition[date, CelestialSystem -> "Equatorial"]];
moonRA = First[MoonPosition[date, CelestialSystem -> "Equatorial"]];
planetsRA = EntityValue[{Entity["Planet", "Mercury"], Entity["Planet", "Venus"], Entity["Planet", "Mars"], Entity["Planet", "Jupiter"], Entity["Planet", "Saturn"], Entity["Planet", "Uranus"], Entity["Planet", "Neptune"]}, EntityProperty["Planet", "RightAscension", {"Date" -> date}]];
ascensions = Join[{sunRA, moonRA}, planetsRA]

Out[3]= {Quantity[7.003538568178052, "HoursOfRightAscension"], Quantity[12.105768150589997, "HoursOfRightAscension"], Quantity[MixedMagnitude[{6, 5, 36.2}], MixedUnit[{"HoursOfRightAscension", "MinutesOfRightAscension", "SecondsOfRightAscension"}]], Quanti ... nitude[{3, 2, 19.5}], MixedUnit[{"HoursOfRightAscension", "MinutesOfRightAscension", "SecondsOfRightAscension"}]], Quantity[MixedMagnitude[{23, 45, 6.1}], MixedUnit[{"HoursOfRightAscension", "MinutesOfRightAscension", "SecondsOfRightAscension"}]]}
```

Construct text labels for them:

```wl
In[4]:=
symbols = {"☼", "☾", "☿", "♀", "♂", "♃", "♄", "♅", "♆"};
colors = {Yellow, White, Orange, Lighter[Blue], Red, Lighter[Purple], Orange, Cyan, Lighter[Blue]};
labels = MapThread[Text[Style[#1, #2, 17], {0, 3.4}.RotationMatrix[#3]]&, {symbols, colors, ascensions}];
```

Plot the directions of the Sun, the Moon and the planets as viewed from the South Pole, with respect to the fixed stars:

```wl
In[5]:=
GeoGraphics[{
	labels, 
	Thick, Black, Arrow[{{0, 0}, Here}], 
	GeoStyling[Opacity[.5]], NightHemisphere[date], 
	Thickness[.005], Opacity[.5], Line[Pi{{{-1, 0}, {1, 0}}, {{0, -1}, {0, 1}}}]
	}, 
	GeoRange -> "World", GeoProjection -> {"AzimuthalEquidistant", "Centering" -> {-90, Longitude[loc] - sidtime}}, GeoBackground -> GeoStyling["ReliefMap"], 
	Background -> Black, PlotRange -> 4, 
	PlotLabel -> sidtime, LabelStyle -> White
	]

Out[5]= [image]
```

## See Also

* [`DaylightQ`](https://reference.wolfram.com/language/ref/DaylightQ.en.md)
* [`AstroPosition`](https://reference.wolfram.com/language/ref/AstroPosition.en.md)
* [`MoonPosition`](https://reference.wolfram.com/language/ref/MoonPosition.en.md)
* [`AstroSubpoint`](https://reference.wolfram.com/language/ref/AstroSubpoint.en.md)
* [`StarData`](https://reference.wolfram.com/language/ref/StarData.en.md)
* [`MoonPhase`](https://reference.wolfram.com/language/ref/MoonPhase.en.md)
* [`SolarEclipse`](https://reference.wolfram.com/language/ref/SolarEclipse.en.md)
* [`LunarEclipse`](https://reference.wolfram.com/language/ref/LunarEclipse.en.md)
* [`SiderealTime`](https://reference.wolfram.com/language/ref/SiderealTime.en.md)
* [`TideData`](https://reference.wolfram.com/language/ref/TideData.en.md)

## Related Guides

* [Astronomical Computation & Data](https://reference.wolfram.com/language/guide/AstronomicalComputationAndData.en.md)
* [Date & Time](https://reference.wolfram.com/language/guide/DateAndTime.en.md)
* [Weather Data](https://reference.wolfram.com/language/guide/WeatherData.en.md)
* [People & History](https://reference.wolfram.com/language/guide/PeopleAndHistory.en.md)
* [`Geodesy`](https://reference.wolfram.com/language/guide/Geodesy.en.md)

## History

* [Introduced in 2014 (10.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn100.en.md) \| [Updated in 2023 (13.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn133.en.md)