- Timestamp:
- Dec 3, 2008 12:49:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r457 r459 601 601 End 602 602 603 //phi is defined from +x axis, proceeding CCW around [0,2Pi]604 Threadsafe Function FindPhi(vx,vy)605 variable vx,vy606 607 variable phi608 609 phi = atan(vy/vx) //returns a value from -pi/2 to pi/2610 611 // special cases612 if(vx==0 && vy > 0)613 return(pi/2)614 endif615 if(vx==0 && vy < 0)616 return(3*pi/2)617 endif618 if(vx >= 0 && vy == 0)619 return(0)620 endif621 if(vx < 0 && vy == 0)622 return(pi)623 endif624 625 626 627 if(vx > 0 && vy > 0)628 return(phi)629 endif630 if(vx < 0 && vy > 0)631 return(abs(phi) + pi/2)632 endif633 if(vx < 0 && vy < 0)634 return(phi + pi)635 endif636 if( vx > 0 && vy < 0)637 return(abs(phi) + 3*pi/2)638 endif639 640 return(phi)641 end642 603 643 604
Note: See TracChangeset
for help on using the changeset viewer.