]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/UIUCModel/uiuc_getwind.cpp
Goodbye automake.
[flightgear.git] / src / FDM / UIUCModel / uiuc_getwind.cpp
index 810feef4459d4833d3168dbeaa1950ba50c99764..35628407b85b976b9ec471f43554d8f51382500d 100644 (file)
@@ -58,8 +58,7 @@
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA or view http://www.gnu.org/copyleft/gpl.html.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 **********************************************************************/
 
@@ -101,9 +100,12 @@ void uiuc_getwind()
        /* Get wind vector */
        double windmag = 0; //Wind magnitude
        double a = 0; //Parabola: Altitude = a*windmag^2 + zoff
+        double x = pow(uref,2.);
        
-       a = zref/pow(uref,2.);
-       if (Altitude >= zoff)
+        if (x) {
+           a = zref/x;
+        }
+       if ((Altitude >= zoff) && (a > 0))
                windmag = sqrt(Altitude/a);
        else
                windmag = 0.;