Changed altitude discrete calculation

Changed altitude discrete calculation to use an equation for a better
range of values.