Changeset 7695
 Timestamp:
 Apr 23, 2010, 10:15:46 PM (10 years ago)
 Location:
 anuga_core/source/anuga/abstract_2d_finite_volumes
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py
r7672 r7695 1626 1626 assert v==1 1627 1627 1628 1628 def test_calc_bearings_zero_vector(self): 1629 from math import atan, degrees 1630 1631 uh = 0 1632 vh = 0 1633 angle = calc_bearing(uh, vh) 1634 1635 assert angle == NAN 1636 1629 1637 # 1630 1638 
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r7693 r7695 14 14 from shutil import copy 15 15 16 from anuga.utilities.numerical_tools import ensure_numeric, angle 16 from anuga.utilities.numerical_tools import ensure_numeric, angle, NAN 17 17 18 18 from math import sqrt, atan, degrees … … 300 300 # * moving the reference direction from [1,0] to North 301 301 # * changing from counter clockwise to clocwise. 302 303 # if indeterminate, just return 304 if uh==0 and vh==0: 305 return NAN 302 306 303 307 return degrees(angle([uh, vh], [0, 1]))
Note: See TracChangeset
for help on using the changeset viewer.