Click or drag to resize

CentralBodiesFacet Class

A CalculationContextFacet that holds and provides information about central bodies such as planets, moons, the sun, etc.
Inheritance Hierarchy

Namespace:  AGI.Foundation.Celestial
Assembly:  AGI.Foundation.Models (in AGI.Foundation.Models.dll) Version: 22.2.414.0 (22.2.414.0)
public class CentralBodiesFacet : CalculationContextFacet, 
	IEnumerable<CentralBody>, IEnumerable

The CentralBodiesFacet type exposes the following members.

Public methodCentralBodiesFacet
Initializes a new instance with default values. You should generally call the GetFromContext method instead of constructing a new instance.
Protected methodCentralBodiesFacet(CentralBodiesFacet, CopyContext)
Initializes a new instance as a copy of an existing instance.
Public propertyEarth
Gets the planet Earth.
Public propertyIsThreadSafe
Gets a value indicating whether the methods on this instance are safe to call from multiple threads simultaneously.
(Overrides CalculationContextFacetIsThreadSafe.)
Public propertyMoon
Gets the Moon.
Public propertySolarSystemBarycenter
Gets the barycenter of the solar system.
Public propertySun
Gets the Sun.
Public methodClone
Clones this object using the specified context.
(Overrides CalculationContextFacetClone(CopyContext).)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetByName
Gets a central body by name.
Public methodGetCentralBodyOfPoint
Gets the central body most closely associated with a given point.
Public methodGetEnumerator
Enumerates the central bodies.
Public methodStatic memberCode exampleGetFromContext
Gets the CentralBodiesFacet instance from the calculation context. If the context does not contain a CentralBodiesFacet instance, one will be created.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUseInCurrentContext
Adds this instance to the current context, making it the official instance of this facet type in the context.
(Overrides CalculationContextFacetUseInCurrentContext.)
Use the GetFromContext method to obtain an instance of type, instead of constructing a new one.

This example shows how to obtain the Earth central body:

EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;
See Also