# Degrees to Coordinates

Hey, I'm creating my second game ever, but this time - using Java. Before I used Pascal and CRT module! =D It's 2D game where you need to drag the ball with mouse from location A to location B. Right now, I have ball on location A and I want to make it "alive". With that I mean that it will move from location A in 135° direction until it reaches wall, then bounce the wall and move in 45° direction, then again wall - in 315° and so on. Let's imagine that all board is 460x640 units big. So, as you can see in image above, ball's start location is 0. When the ball for the first time bounce the wall, location may be like x = 400, y = 480. In this example I have four possible directions like North, East, South and West, but in real game, when player drags the ball with his mouse, options may be more, right? I think so. So I think that I need to use degrees for it. I made list as example of what do I mean...

45°:

x = x + .5, y = y - .5

90°:

x = x + 1, y = y + 0

135°:

x = x + .5, y = y + .5

180°:

x = x + 0, y = y + 1

225°:

x = x - .5, y = y + .5

270°:

x = x - 1, y = y + 0

315°:

x = x - .5, y = y - .5

360°:

x = x + 0, y = y - 1

246°:

x = ?, y = ?

The main problem is that I don't know how to covert degrees to coordinates and vice versa. For example I need to know x and y for 246°. Why? By knowing x and y I can move ball, because all my application basically is infinite loop that takes pause, then calculate x and y from degrees and then move ball. Please keep in mind that I'm very newbie to games development, I'm not good at math (unfortunately) and English isn't my native language... as you can see.

P.S. Maybe all idea about how-to is wrong!??