@staticmethod
def minMaxDistance(obj1, obj2):
    """Computes the min max distance used for feature grouping"""
    commonTimeInterval = obj1.commonTimeInterval(obj2)
    if not commonTimeInterval.empty():
        minDistance = (obj1.getPositionAtInstant(commonTimeInterval.first) -
            obj2.getPositionAtInstant(commonTimeInterval.first)).norm2()
        maxDistance = minDistance
        for t in list(commonTimeInterval)[1:]:
            d = (obj1.getPositionAtInstant(t) - obj2.getPositionAtInstant(t)
                ).norm2()
            if d < minDistance:
                minDistance = d
            elif d > maxDistance:
                maxDistance = d
        return int(commonTimeInterval.length()), minDistance, maxDistance
    else:
        return int(commonTimeInterval.length()), None, None
