# Sun class

Namespace: [Rhino.Render](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.render.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
public sealed class Sun : DocumentOrFreeFloatingBase, IDisposable
```

Represents the Sun on a little portion of Earth.

## Constructors

- [Sun](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/ctor.md): Create a utility object not associated with any document

## Finalizer

- [~Sun](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/finalize.md)

## Properties

- [Accuracy](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/accuracy.md): Accuracy.
- [Altitude](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/altitude.md): The sun's altitude above the horizon in degrees in the range -90 to +90. Setting this value will also set the sun to manual control mode.
- [Azimuth](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/azimuth.md): The sun's azimuth in degrees. The value increases Eastwards with North as zero. Setting this value will also set the sun to manual control mode. Note: This value is not affected by the direction of north.
- [DaylightSaving](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/daylightsaving.md): (obsolete)
- [DaylightSavingMinutes](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/daylightsavingminutes.md): Daylight saving time in minutes
- [DaylightSavingOn](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/daylightsavingon.md): Daylight saving time 'on' state
- [Enabled](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/enabled.md): Turn the sun on/off in this document.
- [Hash](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/hash.md): Get a hash of the sun state.
- [Intensity](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/intensity.md): Sun intensity.
- [Latitude](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/latitude.md): The observer's latitude.
- [Light](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/light.md): Get a Light which represents the sun. If manual control is in effect, no sun calculation is performed; the function uses the last known values of azimuth and altitude. If manual control is not in effect, the observer's position, date, time, time zone and daylight saving values are used to calculate the position of the sun.
- [Longitude](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/longitude.md): The observer's longitude.
- [ManualControl](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/manualcontrol.md): (obsolete)
- [ManualControlOn](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/manualcontrolon.md): Manual control 'on' state. When true, allows the user to set the sun azimuth and altitude directly. When false, the values are computed.
- [North](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/north.md): Angle in degrees on world X-Y plane that should be considered north in the model. The angle is measured starting at the x-axis and increases anti-clockwise. The y-axis corresponds to a 'north' angle of 90 degrees.
- [SkylightOn](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/skylighton.md): (obsolete) Turn skylight on or off.
- [TimeZone](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/timezone.md): The observer's time zone measured in hours relative to UTC.
- [Vector](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/vector.md)

## Methods

- [AltitudeFromValues](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/altitudefromvalues.md): (static)
- [ColorFromAltitude](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/colorfromaltitude.md): (static) Get sun color based on altitude.
- [CopyFrom](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/copyfrom.md)
- [Dispose](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/dispose.md)
- [GetDateTime](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/getdatetime.md): Get the observer's date and time as a DateTime with kind DateTimeKind.Local. Param 'kind' specifies the kind of date and time to retrieve from the sun.If DateTimeKind.Local, the returned DateTime will contain the local sun time, i.e., the time you see in the UI under 'Local'.; If DateTimeKind.Utc, the returned DateTime will contain the UTC sun time, i.e., the time you see in the UI under 'UTC', which is the Sun's local time adjusted for its time zone and daylight saving (if any).**** Local sun time is to do with the Sun's time zone and not the time zone of the computer. **** The returned DateTime object always has a kind of Local even if you requested the sun's UTC date and time. This is because the Sun's time zone is nothing to do with the actual computer's time zone and converting the result would cause further confusion.
- [Here](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/here.md): (static)
- [JulianDay](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/julianday.md): (static)
- [SetDateTime](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/setdatetime.md): Set the observer's date and time. kind specifies the kind of date and time to set to the sun. Note that this is distinct from the DateTimeKind of 'time' which has nothing to do with the sun's local/UTC scenario.If 'kind' is DateTimeKind.Local, the sun's local time will be set, i.e., the time you see in the UI under 'Local'. This is the preferred way to use this function.; If 'kind' is DateTimeKind.Utc, the sun's UTC time will be set, i.e., the time you see in the UI under 'UTC'. This is only for completeness; it's not likely to be useful, but if you do use it, be aware that the sun will convert this time to local using its currently set time zone and daylight saving information (not the locale's information).Caveat: Local sun time is to do with the Sun's time zone and not the time zone of the computer. Caveat: If the supplied DateTime object has a kind of Local, it will be used verbatim. If, however, it has a kind of Utc, it will be converted to local time on the computer using the computer's time zone and daylight saving locale information before being passed to the sun. To avoid confusion, it's best to always use DateTimes with Kind 'Local' when setting the sun's date and time. This is because the Sun's time zone is nothing to do with the actual computer's time zone.
- [SetPosition](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/setposition.md): (2 overloads, obsolete)
- [ShowDialog](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/showdialog.md): (obsolete) Show the modal sun dialog.
- [SunDirection](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/sundirection.md): (static)
- [TwilightZone](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/twilightzone.md): (static)

## Events

- [Changed](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.sun/changed.md): (static) This event is raised when a Sun property value is changed.

## Inherited Members

- From [DocumentOrFreeFloatingBase](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.documentorfreefloatingbase.md): [BeginChange](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.documentorfreefloatingbase/beginchange.md), [EndChange](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.documentorfreefloatingbase/endchange.md)
