Changeset 1158 for XIOS/dev/dev_olga/extern/remap/src/triple.cpp
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/extern/remap/src/triple.cpp
r849 r1158 124 124 } 125 125 126 // return oriented vector angle in range [-pi..pi], pole must be orthogonal to a and b 127 double vectAngle(const Coord &a, const Coord &b, const Coord &pole) 128 { 129 double nab = 1./(norm(a)*norm(b)) ; 130 131 Coord a_cross_b=crossprod(a, b)*nab ; 132 double sinVect ; 133 if (scalarprod(a_cross_b, pole) >= 0) sinVect=norm(a_cross_b) ; 134 else sinVect=-norm(a_cross_b) ; 135 double cosVect=scalarprod(a,b)*nab ; 136 137 return atan2(sinVect,cosVect) ; 126 138 } 139 140 }
Note: See TracChangeset
for help on using the changeset viewer.