Click or drag to resize

CentralBodiesFacetGetFromContext Method

Gets the CentralBodiesFacet instance from the calculation context. If the context does not contain a CentralBodiesFacet instance, one will be created.

Namespace:  AGI.Foundation.Celestial
Assembly:  AGI.Foundation.Models (in AGI.Foundation.Models.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public static CentralBodiesFacet GetFromContext()

Return Value

Type: CentralBodiesFacet
The instance from the context.
Remarks
If a CentralBodiesFacet instance does not already exist in the CalculationContext, a default one is created. The default CentralBodiesFacet instance has a default constructed instance of each central body. See the documentation for the default constructor of each central body class for information about the defaults. For example, see EarthCentralBody and SunCentralBody.
Examples

This example shows how to obtain the Earth central body:

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