code: function positionToPercent(position) {
        var offset = vertical ? sliderDimensions.top : sliderDimensions.left;
        var size = vertical ? sliderDimensions.height : sliderDimensions.width;
        var calc = (position - offset) / size;
  
        if (!vertical && $mdUtil.bidi() === 'rtl') {
          calc = 1 - calc;
        }
  
        return Math.max(0, Math.min(1, vertical ? 1 - calc : calc));
      }
docs: Convert position on slider to percentage value of offset from beginning...
  @param position
  @returns {number}