[genius] Fri Oct 25 08:35:40 2013 Jiri (George) Lebl <jirka 5z com>



commit 9a11d8d99c9184f7c18f3227860af64885ef7210
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Fri Oct 25 08:35:44 2013 -0500

    Fri Oct 25 08:35:40 2013  Jiri (George) Lebl <jirka 5z com>
    
        * src/graphing.c: improve logic for jump detection (still not
          perfect)

 ChangeLog      |    5 +++++
 src/graphing.c |   12 ++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a64efec..18a9747 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 25 08:35:40 2013  Jiri (George) Lebl <jirka 5z com>
+
+       * src/graphing.c: improve logic for jump detection (still not
+         perfect)
+
 Thu Oct 24 23:51:15 2013  Jiri (George) Lebl <jirka 5z com>
 
        * src/graphing.c: better detection of jumps due to vertical
diff --git a/src/graphing.c b/src/graphing.c
index 085f50f..175f7f5 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -4422,10 +4422,14 @@ recompute_function (int funci, double **x, double **y, int *len, gboolean fittin
 
                        /* too steep! and steeper than surrounding which is derivative at most 10,
                         * or if the prev and next derivatives are of different sign */
-                       if ( (10.0*fabs(xprevdiffscaled) >= fabs(yprevdiffscaled) && 
-                             10.0*fabs(xnextdiffscaled) >= fabs(ynextdiffscaled)) ||
-                            ( ydiffscaled > 0.0 && ynextdiffscaled < 0.0 && yprevdiffscaled < 0.0) ||
-                            ( ydiffscaled < 0.0 && ynextdiffscaled > 0.0 && yprevdiffscaled > 0.0) )  {
+                       if ( (10.0*fabs(xprevdiffscaled) >= fabs(yprevdiffscaled) ||
+                             (ydiffscaled > 0.0 && yprevdiffscaled < 0.0) ||
+                             (ydiffscaled < 0.0 && yprevdiffscaled > 0.0) )
+                            &&
+                            (10.0*fabs(xnextdiffscaled) >= fabs(ynextdiffscaled) ||
+                             (ydiffscaled > 0.0 && ynextdiffscaled < 0.0) ||
+                             (ydiffscaled < 0.0 && ynextdiffscaled > 0.0) )
+                            ) {
                                Point *newpt;
                                newpt = g_new0 (Point, 1);
                                newpt->x = BADPTVAL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]