import math


def xy(x=0, y=0, direction=0.0, amount=0):
    """Returns a new (x,y) coordinate after adding the amount in
    the given direction."""
    angle = math.radians(float(direction))
    return (math.sin(angle) * amount + x, math.cos(angle) * amount + y)