import math


def angle_to_pixel(angle, fov, num_pixels):
    """
    angle: object angle
    fov: field of view of the camera
    num_pixels: number of pixels along the dimension that fov was measured
    """
    if angle > 90.0 or angle < -90.0:
        raise ValueError

    x = math.tan(math.radians(angle))
    limit = math.tan(math.radians(fov / 2))
    return int(x / limit * num_pixels / 2 + num_pixels / 2)