# Path: qwt/_math.py
# def qwtFuzzyCompare(value1, value2, intervalSize):
#     eps = abs(1.0e-6 * intervalSize)
#     if value2 - value1 > eps:
#         return -1
#     elif value1 - value2 > eps:
#         return 1
#     else:
#         return 0


from qwt._math import qwtFuzzyCompare
from qtpy.QtCore import QRectF, QPointF

            :param QPointF pos: Position in scale coordinates

        Scalar: scalemap.transform(scalar)
        Point (QPointF): scalemap.transform(xMap, yMap, pos)
        Rectangle (QRectF): scalemap.transform(xMap, yMap, rect)

        .. seealso::

            :py:meth:`invTransform()`
        """
        if len(args) == 1:
            # Scalar transform
            return self.transform_scalar(args[0])
        elif len(args) == 3 and isinstance(args[2], QPointF):
            xMap, yMap, pos = args
            return QPointF(xMap.transform(pos.x()), yMap.transform(pos.y()))
        elif len(args) == 3 and isinstance(args[2], QRectF):
            xMap, yMap, rect = args
            x1 = xMap.transform(rect.left())
            x2 = xMap.transform(rect.right())
            y1 = yMap.transform(rect.top())
            y2 = yMap.transform(rect.bottom())
            if x2 < x1:
                x1, x2 = x2, x1
            if y2 < y1:
                y1, y2 = y2, y1
            if qwtFuzzyCompare(x1, 0.0, x2 - x1) == 0:
                x1 = 0.0
            if qwtFuzzyCompare(x2, 0.0, x2 - x1) == 0:
                x2 = 0.0

# Path: qwt/_math.py
# def qwtFuzzyCompare(value1, value2, intervalSize):
#     eps = abs(1.0e-6 * intervalSize)
#     if value2 - value1 > eps:
#         return -1
#     elif value1 - value2 > eps:
#         return 1
#     else:
#         return 0


# Path: qwt/scale_map.py
from qwt._math import qwtFuzzyCompare
from qtpy.QtCore import QRectF, QPointF

            :param QPointF pos: Position in scale coordinates

        Scalar: scalemap.transform(scalar)
        Point (QPointF): scalemap.transform(xMap, yMap, pos)
        Rectangle (QRectF): scalemap.transform(xMap, yMap, rect)

        .. seealso::

            :py:meth:`invTransform()`
        """
        if len(args) == 1:
            # Scalar transform
            return self.transform_scalar(args[0])
        elif len(args) == 3 and isinstance(args[2], QPointF):
            xMap, yMap, pos = args
            return QPointF(xMap.transform(pos.x()), yMap.transform(pos.y()))
        elif len(args) == 3 and isinstance(args[2], QRectF):
            xMap, yMap, rect = args
            x1 = xMap.transform(rect.left())
            x2 = xMap.transform(rect.right())
            y1 = yMap.transform(rect.top())
            y2 = yMap.transform(rect.bottom())
            if x2 < x1:
                x1, x2 = x2, x1
            if y2 < y1:
                y1, y2 = y2, y1
            if qwtFuzzyCompare(x1, 0.0, x2 - x1) == 0:
                x1 = 0.0
            if qwtFuzzyCompare(x2, 0.0, x2 - x1) == 0:
                x2 = 0.0

            if qwtFuzzyCompare(y1, 0.0, y2 - y1) == 0:
