feat: move stuff to numerics
This commit is contained in:
parent
465ad00f7b
commit
b7fd7046ff
5 changed files with 119 additions and 29 deletions
|
|
@ -23,3 +23,16 @@ func NasaDensity(alt float64) float64 {
|
|||
}
|
||||
return pressure / (0.2869 * (temp + 273.1))
|
||||
}
|
||||
|
||||
// DragTerminalVelocity returns the vertical velocity (m/s, negative = downward)
|
||||
// of a parachute descent at the given altitude. seaLevelRate is the descent
|
||||
// speed at sea level (positive m/s); the rate grows with altitude as the
|
||||
// thinner air provides less drag:
|
||||
//
|
||||
// v = -k / sqrt(rho(alt)), k = seaLevelRate * 1.1045
|
||||
//
|
||||
// Matches Tawhiri's drag_descent.
|
||||
func DragTerminalVelocity(seaLevelRate, alt float64) float64 {
|
||||
k := seaLevelRate * 1.1045
|
||||
return -k / math.Sqrt(NasaDensity(alt))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue