import math


def calSlope(line):
    """Calculate the slope of a given line."""
    deltaX=line.upperPoint.x-line.lowerPoint.x 
    deltaY=line.upperPoint.y-line.lowerPoint.y 

    if deltaX!=0.0:
        return deltaY/deltaX
    else:
        return math.inf