Index: trunk/ippScripts/scripts/magic_tree.pl
===================================================================
--- trunk/ippScripts/scripts/magic_tree.pl	(revision 15683)
+++ trunk/ippScripts/scripts/magic_tree.pl	(revision 15688)
@@ -164,11 +164,11 @@
     $crval2 = deg2rad($crval2);
     my $ra = $crval1 + atan2(cos($theta) * sin($phi),
-			     sin($theta) * cos($crval2) - cos($theta) * sin($crval2) * cos($phi));
-    my $dec = asin(sin($theta) * sin($crval2) + cos($theta) * cos($crval2) * cos($phi));
-    
+			     sin($theta) * cos($crval2) + cos($theta) * sin($crval2) * cos($phi));
+    my $dec = asin(sin($theta) * sin($crval2) - cos($theta) * cos($crval2) * cos($phi));
+
     # Rotate to boresight
     my $phi_new = atan2(cos($dec) * sin($ra - $ra0), 
-			sin($dec) * cos($dec0) - cos($dec) * sin($dec0) * cos($ra - $ra0));
-    my $theta_new = asin(sin($dec) * sin($dec0) + cos($dec) * cos($dec0) * cos($ra - $ra0));
+			sin($dec) * cos($dec0) + cos($dec) * sin($dec0) * cos($ra - $ra0));
+    my $theta_new = asin(sin($dec) * sin($dec0) - cos($dec) * cos($dec0) * cos($ra - $ra0));
 
     # Project
