Both of the posts above me give you information to find the solution. So don't dismiss them . Read the links they provided.
Down Below is the process for obtaining the solutions. A few other things you might want to look at to understand what I did here...
This is a trig circle. This graph will show you some very useful information that can provide shortcuts, as well as some insights when you take a trig class. This graph shows how angles and it's comparable radian format will act when inputed into the functions sin and cos.
When you read it, remember that X is usually seen as Cos, and Y is seen as Sin.
(Cos, Sin)
https://lelandmath.files.wordpress.com/2013/10/screen-shot-2013-10-14-at-7-19-46-pm.png
Let's begin.
With Theta being 30.
And our Axis is (0,0)
Because we start out with our objects reference frame rotation being zero, we can go ahead and remove the y component to get R.
PROOF
sqrt(r2 = 402 + 02) is r=40
So...
r = 40
Theta = 30 deg
So... Polar Co-ordinates (r,theta) are (40, 30degrees) respectively.
This equates too...
x = 40 * COS(30) = 40 * (31/2/2) = 20*31/2 =APROX= 35
y = 40 * SIN(30) = 40/2 = 20
After calculation you have new coordinates
(x,y) = (35,20)
A few notes. Notice that our endpoint is not on y? This is because a rotation conserves the line's original length. What happens in Trig is that you make a circle as you rotate upon a point.
https://www.mathsisfun.com/algebra/trigonometry.html
Keep in mind, if you are doing this for a game... this is going to be horrendously slow. Your best bet would be to use a matrix.