atmosphere: fix density calculations
This commit is contained in:
parent
b348b3524a
commit
5f1c15e614
|
@ -122,8 +122,8 @@ Density:
|
|||
- 500km-1029.2km: `rho[kg/m³](x[m]) = exp(-15.98781474626208 - 0.00000816092074*x)`
|
||||
- 200km-500km: `rho[kg/m³](x[m]) = exp(-4.22487505187567 - 0.00003251947782*x)`
|
||||
- 0km-200km: `rho[kg/m³](x[m]) = exp(-1.83275074106303 - 0.00004486861245*x)`
|
||||
- -62000km-0km: `rho[kg/m³](x[m]) = -0.0725781*x + 0.16` (linear regression)
|
||||
- -70000km-62000km: `rho[kg/m³](x[m]) = 25000.0 / (1 + exp(0.00580528 * x + 361.44394)))` (logistic regression)
|
||||
- -62000km-0km: `rho[kg/m³](x[m]) = -0.0000725781*x + 0.16` (linear regression)
|
||||
- -70000km-62000km: `rho[kg/m³](x[m]) = 25000.0 / (1 + exp(0.00000580528 * x + 361.44394)))` (logistic regression)
|
||||
|
||||
### Designing the in-game atmosphere
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ pub fn jupiter_altitude_to_density(altitude: f64) -> f64 {
|
|||
} else if x >= 0.0 {
|
||||
return (-1.83275074106303 - 0.00004486861245 * x).exp();
|
||||
} else if x >= -62000e3 {
|
||||
return -0.0725781 * x + 0.16;
|
||||
return -0.0000725781 * x + 0.16;
|
||||
}
|
||||
return 25000.0 / (1.0 + (0.00580528 * x + 361.44394)).exp();
|
||||
return 25000.0 / (1.0 + (0.00000580528 * x + 361.44394).exp());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue