def convert_to_2d(
    x: float, y: float, z: float, scale: float, distance: float
) -> tuple[float, float]:
    if not all(isinstance(val, (float, int)) for val in locals().values()):
        raise TypeError(
            "Input values must either be float or int: " f"{list(locals().values())}"
        )
    projected_x = ((x * distance) / (z + distance)) * scale
    projected_y = ((y * distance) / (z + distance)) * scale
    return projected_x, projected_y