import math


def compute_velocity(center1, center2, fps):
    """
    Compute each spectator's movement speed between current frame and previous frame.
    :param center1: person's position of previous frame
    :param center2: person's position of current frame
    :param fps: the FPS parameter
    :return: the movement speed
    """
    # MPP
    # Carbao108:0.019
    # Carbao205:0.016
    # Carbao248:0.009
    # FA-108:0.016
    # FA-205:0.014
    MPP = 0.014
    d_pixels = math.sqrt(math.pow(center2[0] - center1[0], 2) + math.pow(center2[1] - center1[1], 2))
    d_meters = MPP * d_pixels
    speed = d_meters * fps * 3.6
    return speed, d_meters