Revision: 12787
          http://sourceforge.net/p/skim-app/code/12787
Author:   hofman
Date:     2022-02-13 17:03:20 +0000 (Sun, 13 Feb 2022)
Log Message:
-----------
workaround for peoblems of atan around +-pi/2

Modified Paths:
--------------
    trunk/SkimTransitions/SKTTransitions.cikernel

Modified: trunk/SkimTransitions/SKTTransitions.cikernel
===================================================================
--- trunk/SkimTransitions/SKTTransitions.cikernel       2022-02-13 16:29:36 UTC 
(rev 12786)
+++ trunk/SkimTransitions/SKTTransitions.cikernel       2022-02-13 17:03:20 UTC 
(rev 12787)
@@ -59,7 +59,7 @@
     pi2 = 2.0 * pi;
     
     t1 = destCoord() - center;
-    a1 = 0.5 * pi - atan(t1.x, t1.y);
+    a1 = t1.y != 0.0 ? 0.5 * pi - atan(t1.x, t1.y) : (t1.x > 0.0 ? 0.0 : (t1.x 
< 0.0 ? pi : 0.5 * pi));
     da1 = mod(angle - a1 + 0.5 * width, pi2);
     da2 = mod(da1 + pi, pi2) - pi;
     angle1 = 2.0 * (pi + width) * t;
@@ -80,7 +80,7 @@
     
     loc = destCoord() - center;
     r = sqrt(dot(loc, loc));
-    a = atan(loc.y, loc.x) - pi2 * t * t / (1.0 + 0.01 * r);
+    a = (loc.x != 0.0 ? atan(loc.y, loc.x) : loc.y < 0.0 ? -0.25 * pi2 : loc.y 
> 0.0 ? 0.25 * pi2 : 0.0) - pi2 * t * t / (1.0 + 0.01 * r);
     a = a > -0.5 * pi2 ? a : a + pi2;
 
     extent = samplerExtent(src);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to