POV-Ray : Newsgroups : povray.general : Function for air density : Re: Function for air density Server Time
30 Jul 2024 06:21:10 EDT (-0400)
  Re: Function for air density  
From: triple r
Date: 31 Aug 2009 23:45:00
Message: <web.4a9c98231540ef51805d39df0@news.povray.org>
SharkD <mik### [at] gmailcom> wrote:
> Thanks! The functions use multi-valued constants that will be tricky to
> implement. Also, there are no functions for values beyond 71km. Is that
> because the air so so thin that it's not worth calculating?

The atmosphere is made up of different layers, each with their own typical
temperature gradient.  Just because the last reference point is at 71km, that
doesn't mean the formulae are not valid beyond that point.  It just means that
most of the interesting features are below.

If you just want a good approximation,

exp(-1.4237e-4 * h)

is a good approximation on a log scale, where h is in meters.  That tends to
overpredict where the density is large, so

exp(-1.2e-4 * h)

is a much better approximation for low altitudes.  Of course it overpredicts
high altitudes where the densities are tiny anyway.  These are just based on
least squares and eyeballing, respectively.  Which one to choose just depends
what you need it for.  If you're looking to model it with media or something,
I'd just split the difference.  It'd be in the ballpark anyway.  If you really
need it to be accurate, then work on implementing the formula on Wikipedia.

 - Ricky


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.