Ignore:
Timestamp:
Apr 23, 2010, 10:15:46 PM (13 years ago)
Author:
hudson
Message:

calc_bearing handles cases where the speed is zero, and outputs NaN.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/util.py

    r7693 r7695  
    1414from shutil import copy
    1515
    16 from anuga.utilities.numerical_tools import ensure_numeric, angle
     16from anuga.utilities.numerical_tools import ensure_numeric, angle, NAN
    1717
    1818from math import sqrt, atan, degrees
     
    300300    # * moving the reference direction from [1,0] to North
    301301    # * changing from counter clockwise to clocwise.
     302
     303    # if indeterminate, just return
     304    if uh==0 and vh==0:
     305        return NAN
    302306   
    303307    return degrees(angle([uh, vh], [0, -1]))   
Note: See TracChangeset for help on using the changeset viewer.