POV-Ray : Newsgroups : povray.general : Function for air density : Re: Function for air density Server Time
30 Jul 2024 06:28:05 EDT (-0400)
  Re: Function for air density  
From: SharkD
Date: 1 Sep 2009 18:41:16
Message: <4a9da30c$1@news.povray.org>
triple_r wrote:
> 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


I'm applying the media to the difference of two very large spheres. 
Currently, the inner sphere (the Earth's radius) is set to "6375000 * 
Meters", where Meters is equal to 4. I'm not sure how big to make the 
outer sphere.

Could you please rewrite your density function to take this into 
account? I've created a few patterns that begin and end at X distances 
away from the center. I managed to get them to work if they are linear, 
but act strange when the functions are non-linear.

-Mike


Post a reply to this message

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