Conversion of polar coords. into rectangular ones and viceversa:
to convert polar coords. into rectangular ones, use:
x=sin(r)*d
y=cos(r)*d
to convert rectangular coords. into polar ones, use:
d=sqrt(sqr(x)+sqr(y))
r=atan2(x,y)
I hope I am right, correct me if I am not.
I can explain, how d=sqrt(sqr(x)+sqr(y)) works.
code:
So, here's the deal:
suppose x=.8 and y=.6, then the position of point point would be:
yaxis
^

P Q
.6      .(.8,.6)
 
 
S R
xaxis <                >
(0,0) .8






(this is an approximate figure)
PQRS is the quadrilaeral formed.
Now, we have to find l(SQ) or d(S,Q)
I will solve this as we solve our geomtery problems,
as this will give you a more clear idea.
Given:
1) line x is perpendicaular to line y.
2) d(S,R)=.8 , d(P,S)=.6
3) seg PQ is perpendicular to line y & seg RQ is perpendicular to line x.
to find: d(S,Q) i.e length of seg SQ.
Construction: Draw seg SQ ( I could'nt draw it here ) .
Sol'n:
Statement Reason
1) In, quad. PQRS, 
m<S=m<P=m<Q=m<R=90 degrees statement 1 & 3 of Given.

2) quad. PQRS is a rectangle. Statement 1) and def'n of a rectangle.

3) seg PS is congreuent to seg QR statement 2) and opposite sides of a
 rectangle are congruent.

4) In triangle SQR, given statement 2) and statement 3)
seg SR = .8 and seg QR = .6 

5) In triangle SQR, 
SQ^2 = SR^2 + SQ^2 Pythagorus theorem.
<=> SQ = sqrt ( SR^2 + SQ^2 )
<=> SQ = sqrt ( .8^2 + .6^2 )
<=> SQ = sqrt ( .64 + .36 )
= sqrt ( 1.00 )
= 1
therefore SQ = 1
here, SQ = d
so sqr ( d ) = sqr ( SR ) + sqr ( RQ )
= sqr ( X ) + sqr ( Y ) ( not the lines, but the position of the point )
<=> d = sqrt ( sqr ( X ) + sqr ( Y )
It would be nice if someone explained how r=atan2(x,y) works.
NOte: my first experiment without smiley's *I smile*