function(type, c, t0, tl) {
      // Compute values for new TouchInfo based on coordinates and previus touches.
      // - c is coords of new touch
      // - t0 is first touch: useful to compute duration and distance (how far pointer
      //                    got from first touch)
      // - tl is last touch: useful to compute velocity and length (total length of the movement)

      t0 = t0 || {};
      tl = tl || {};

      // timestamps
      var ts = now();
      var ts0 = t0.timestamp || ts;
      var tsl = tl.timestamp || ts0;

      // coords
      var x = c.x;
      var y = c.y;
      var x0 = t0.x || x;
      var y0 = t0.y || y;
      var xl = tl.x || x0;
      var yl = tl.y || y0;

      // total movement
      var totalXl = tl.totalX || 0;
      var totalYl = tl.totalY || 0;
      var totalX = totalXl + abs(x - xl);
      var totalY = totalYl + abs(y - yl);
      var total = len(totalX, totalY);

      // duration
      var duration = timediff(ts, ts0);
      var durationl = timediff(ts, tsl);

      // distance
      var dxl = x - xl;
      var dyl = y - yl;
      var dl = len(dxl, dyl);
      var dx = x - x0;
      var dy = y - y0;
      var d = len(dx, dy);

      // velocity (px per second)
      var v = durationl > 0 ? abs(dl / (durationl / 1000)) : 0;
      var tv = duration > 0 ? abs(total / (duration / 1000)) : 0;

      // main direction: 'LEFT', 'RIGHT', 'TOP', 'BOTTOM'
      var dir = abs(dx) > abs(dy) ?
        (dx < 0 ? 'LEFT' : 'RIGHT') :
        (dy < 0 ? 'TOP' : 'BOTTOM');

      // angle (angle between distance vector and x axis)
      // angle will be:
      //   0 for x > 0 and y = 0
      //   90 for y < 0 and x = 0
      //   180 for x < 0 and y = 0
      //   -90 for y > 0 and x = 0
      //
      //               -90°
      //                |
      //                |
      //                |
      //   180° --------|-------- 0°
      //                |
      //                |
      //                |
      //               90°
      //
      var angle = dx !== 0 || dy !== 0 ? atan2(dy, dx) * (180 / Math.PI) : null;
      angle = angle === -180 ? 180 : angle;

      return {
        type: type,
        timestamp: ts,
        duration: duration,
        startX: x0,
        startY: y0,
        prevX: xl,
        prevY: yl,
        x: c.x,
        y: c.y,

        step: dl, // distance from prev
        stepX: dxl,
        stepY: dyl,

        velocity: v,
        averageVelocity: tv,

        distance: d, // distance from start
        distanceX: dx,
        distanceY: dy,

        total: total, // total length of momement,
        // considering turnaround
        totalX: totalX,
        totalY: totalY,
        direction: dir,
        angle: angle
      };
    }
function(type, c, t0, tl) {
      // Compute values for new TouchInfo based on coordinates and previus touches.
      // - c is coords of new touch
      // - t0 is first touch: useful to compute duration and distance (how far pointer
      //                    got from first touch)
      // - tl is last touch: useful to compute velocity and length (total length of the movement)

      t0 = t0 || {};
      tl = tl || {};

      // timestamps
      var ts = now();
      var ts0 = t0.timestamp || ts;
      var tsl = tl.timestamp || ts0;

      // coords
      var x = c.x;
      var y = c.y;
      var x0 = t0.x || x;
      var y0 = t0.y || y;
      var xl = tl.x || x0;
      var yl = tl.y || y0;

      // total movement
      var totalXl = tl.totalX || 0;
      var totalYl = tl.totalY || 0;
      var totalX = totalXl + abs(x - xl);
      var totalY = totalYl + abs(y - yl);
      var total = len(totalX, totalY);

      // duration
      var duration = timediff(ts, ts0);
      var durationl = timediff(ts, tsl);

      // distance
      var dxl = x - xl;
      var dyl = y - yl;
      var dl = len(dxl, dyl);
      var dx = x - x0;
      var dy = y - y0;
      var d = len(dx, dy);

      // velocity (px per second)
      var v = durationl > 0 ? abs(dl / (durationl / 1000)) : 0;
      var tv = duration > 0 ? abs(total / (duration / 1000)) : 0;

      // main direction: 'LEFT', 'RIGHT', 'TOP', 'BOTTOM'
      var dir = abs(dx) > abs(dy) ?
        (dx < 0 ? 'LEFT' : 'RIGHT') :
        (dy < 0 ? 'TOP' : 'BOTTOM');

      // angle (angle between distance vector and x axis)
      // angle will be:
      //   0 for x > 0 and y = 0
      //   90 for y < 0 and x = 0
      //   180 for x < 0 and y = 0
      //   -90 for y > 0 and x = 0
      //
      //               -90°
      //                |
      //                |
      //                |
      //   180° --------|-------- 0°
      //                |
      //                |
      //                |
      //               90°
      //
      var angle = dx !== 0 || dy !== 0 ? atan2(dy, dx) * (180 / Math.PI) : null;
      angle = angle === -180 ? 180 : angle;

      return {
        type: type,
        timestamp: ts,
        duration: duration,
        startX: x0,
        startY: y0,
        prevX: xl,
        prevY: yl,
        x: c.x,
        y: c.y,

        step: dl, // distance from prev
        stepX: dxl,
        stepY: dyl,

        velocity: v,
        averageVelocity: tv,

        distance: d, // distance from start
        distanceX: dx,
        distanceY: dy,

        total: total, // total length of momement,
        // considering turnaround
        totalX: totalX,
        totalY: totalY,
        direction: dir,
        angle: angle
      };
    }
function ( type , c , t0 , tl ) { // Compute values for new TouchInfo based on coordinates and previus touches. // - c is coords of new touch // - t0 is first touch: useful to compute duration and distance (how far pointer //                    got from first touch) // - tl is last touch: useful to compute velocity and length (total length of the movement) t0 = t0 || { } ; tl = tl || { } ; // timestamps var ts = now ( ) ; var ts0 = t0 . timestamp || ts ; var tsl = tl . timestamp || ts0 ; // coords var x = c . x ; var y = c . y ; var x0 = t0 . x || x ; var y0 = t0 . y || y ; var xl = tl . x || x0 ; var yl = tl . y || y0 ; // total movement var totalXl = tl . totalX || 0 ; var totalYl = tl . totalY || 0 ; var totalX = totalXl + abs ( x - xl ) ; var totalY = totalYl + abs ( y - yl ) ; var total = len ( totalX , totalY ) ; // duration var duration = timediff ( ts , ts0 ) ; var durationl = timediff ( ts , tsl ) ; // distance var dxl = x - xl ; var dyl = y - yl ; var dl = len ( dxl , dyl ) ; var dx = x - x0 ; var dy = y - y0 ; var d = len ( dx , dy ) ; // velocity (px per second) var v = durationl > 0 ? abs ( dl / ( durationl / 1000 ) ) : 0 ; var tv = duration > 0 ? abs ( total / ( duration / 1000 ) ) : 0 ; // main direction: 'LEFT', 'RIGHT', 'TOP', 'BOTTOM' var dir = abs ( dx ) > abs ( dy ) ? ( dx < 0 ? 'LEFT' : 'RIGHT' ) : ( dy < 0 ? 'TOP' : 'BOTTOM' ) ; // angle (angle between distance vector and x axis) // angle will be: //   0 for x > 0 and y = 0 //   90 for y < 0 and x = 0 //   180 for x < 0 and y = 0 //   -90 for y > 0 and x = 0 // //               -90° //                | //                | //                | //   180° --------|-------- 0° //                | //                | //                | //               90° // var angle = dx !== 0 || dy !== 0 ? atan2 ( dy , dx ) * ( 180 / Math . PI ) : null ; angle = angle === - 180 ? 180 : angle ; return { type : type , timestamp : ts , duration : duration , startX : x0 , startY : y0 , prevX : xl , prevY : yl , x : c . x , y : c . y , step : dl , // distance from prev stepX : dxl , stepY : dyl , velocity : v , averageVelocity : tv , distance : d , // distance from start distanceX : dx , distanceY : dy , total : total , // total length of momement, // considering turnaround totalX : totalX , totalY : totalY , direction : dir , angle : angle } ; }
`TouchInfo` is an object containing the following extended informations about any touch
event.

@property {string} type Normalized event type. Despite of pointer device is always one of `touchstart`, `touchend`, `touchmove`, `touchcancel`.
@property {Date} timestamp The time object corresponding to the moment this touch event happened.
@property {integer} duration The difference between this touch event and the corresponding `touchstart`.
@property {float} startX X coord of related `touchstart`.
@property {float} startY Y coord of related `touchstart`.
@property {float} prevX X coord of previous `touchstart` or `touchmove`.
@property {float} prevY Y coord of previous `touchstart` or `touchmove`.
@property {float} x X coord of this touch event.
@property {float} y Y coord of this touch event.
@property {float} step Distance between `[prevX, prevY]` and `[x, y]` points.
@property {float} stepX Distance between `prevX` and `x`.
@property {float} stepY Distance between `prevY` and `y`.
@property {float} velocity Instantaneous velocity of a touch event in pixels per second.
@property {float} averageVelocity Average velocity of a touch event from its corresponding `touchstart` in pixels per second.
@property {float} distance Distance between `[startX, startY]` and `[x, y]` points.
@property {float} distanceX Distance between `startX` and `x`.
@property {float} distanceY Distance between `startY` and `y`.
@property {float} total Total number of pixels covered by movement, taking account of direction changes and turnarounds.
@property {float} totalX Total number of pixels covered by horizontal movement, taking account of direction changes and turnarounds.
@property {float} totalY Total number of pixels covered by vertical, taking account of direction changes and turnarounds.
@property {string} direction The current prevalent direction for this touch, one of `LEFT`, `RIGHT`, `TOP`, `BOTTOM`.
@property {float} angle Angle in degree between x axis and the vector `[x, y]`, is `null` when no movement happens.

@class TouchInfo
@ngdoc type
@memberOf mobile-angular-ui.gestures.touch~$touch
TouchInfo is an object containing the following extended informations about any touch event .