Ignore:
Timestamp:
06/06/17 17:58:16 (7 years ago)
Author:
oabramkina
Message:

Two server levels: merging with trunk r1137.
There are bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/extern/remap/src/triple.cpp

    r849 r1158  
    124124} 
    125125 
     126// return oriented vector angle in range [-pi..pi], pole must be orthogonal to a and b 
     127double 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) ; 
    126138} 
     139 
     140} 
Note: See TracChangeset for help on using the changeset viewer.