1 package net.sf.openrocket.aerodynamics;
4 * A gravity model based on the International Gravity Formula of 1967. The gravity
5 * value is computed when the object is constructed and later returned as a static
8 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
10 public class GravityModel {
12 private final double g;
15 * Construct the static gravity model at the specific latitude (in degrees).
16 * @param latitude the latitude in degrees (-90 ... 90)
18 public GravityModel(double latitude) {
19 double sin = Math.sin(latitude * Math.PI/180);
20 double sin2 = Math.sin(2 * latitude * Math.PI/180);
21 g = 9.780327 * (1 + 0.0053024 * sin - 0.0000058 * sin2);
24 public double getGravity() {