"""
This animation example shows how perform a radar sweep animation.
"""

import math

# Set up the constants
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600

CENTER_X = SCREEN_WIDTH // 2
CENTER_Y = SCREEN_HEIGHT // 2
SWEEP_LENGTH = 150

def on_draw(delta_time):
""" Use this function to draw everything to the screen. """

# Move the angle of the sweep.

# Calculate the end point of our radar sweep. Using math.
x = SWEEP_LENGTH * math.sin(on_draw.angle) + CENTER_X
y = SWEEP_LENGTH * math.cos(on_draw.angle) + CENTER_Y

# Start the render. This must happen before any drawing
# commands. We do NOT need an stop render command.

# Draw the outline of the radar

# These are function-specific variables. Before we
# use them in our function, we need to give them initial
# values.
on_draw.angle = 0

# Open up our window