Skip to content

Function: deriveCoreRadiusRatio()

ts
function deriveCoreRadiusRatio(gasMassFraction): number;

Derives the core/shell split from a body's gas-mass fraction using the solid + gas density references. Assumes a two-phase body:

V_solid / V_total = (1 - f) / ((1 - f) + f · ρ_solid / ρ_gas)coreRadiusRatio = ∛(V_solid / V_total)

Boundary behaviour:

  • f = 01.0 (fully solid body, no atmosphere shell)
  • f = 10.0 (pure gas ball, no core — render code must handle coreRadius = 0 by hiding the core mesh)
  • monotonically decreasing in f on [0, 1].

Parameters

ParameterTypeDescription
gasMassFractionnumberFraction of the body's total mass carried by its gas envelope, clamped to [0, 1].

Returns

number

Distribué sous la licence indiquée dans le dépôt.