Changeset 17843 for trunk


Ignore:
Timestamp:
05/13/14 09:21:52 (10 years ago)
Author:
tbretz
Message:
Fixed/simplified width/length/disp calculation by applying the scale factor in the calculation and removing it from the plotting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/viewer/index.js

    r17838 r17843  
    14121412            ctx.save();
    14131413
     1414            ctx.scale(1, 2/Math.sqrt(3));
     1415
    14141416            ctx.translate(h.mean[0], h.mean[1]);
    14151417            ctx.rotate(h.phi);
     
    15111513        return;
    15121514
     1515    // Coordinates need to be scaled in y
     1516    var f = Math.sqrt(3)/2;
     1517
     1518    my  *= f;
     1519    mxy *= f;
     1520    my2 *= f*f;
     1521
    15131522    var xx = mx2 - mx*mx/sz;
    15141523    var yy = my2 - my*my/sz;
     
    15271536
    15281537    // Correction for scale in x
    1529     var f = Math.sqrt(3)/2;
    1530     var ratio = xx/yy/f;
     1538    var ratio = xx/yy;
    15311539
    15321540    if (d1!=0 || d2==0)
     
    15491557        axis1 /= s2;
    15501558        axis2 /= s2;
    1551 
    1552         ratio *= (f + tand*tand)/(tand*tand*f + 1);
    15531559    }
    15541560
     
    15561562    var width  = axis2<0 ? 0 : Math.sqrt(axis2/sz);
    15571563
    1558     //var r = (cos*cos*f + sin*sin)/(sin*sin*f + cos*cos);
    15591564    return {
    15601565        "mean":  [ mx/sz, my/sz ],
     
    15641569        "sumw":  sz,
    15651570        "count": cnt,
    1566         "disp":  1.42/0.1111*(1-Math.sqrt(ratio)),
     1571        "disp":  1.47/0.1111*(1-Math.sqrt(ratio)),
    15671572    };
    15681573}
Note: See TracChangeset for help on using the changeset viewer.