# Spherical coordinates to cartesian coordinates.

I want to find out the distance between the centers of $2$ circles. Say, circle $1$ $(\theta,\phi)$ circle $2$ $(\theta,\phi)$

The radius of this circle is found using $d\tan(\theta)$ where $d$ is the range (different from radius)

$$cd=\sqrt{(x_1-x_2)^2 + (y_1-y_2)^2 + (z_1-z_2)^2}$$ is the formula I'm going to use to find out the distance between the $2$ points.

But can anyone help me in defining $x$, $y$ and $z$?

I know to convert it to Cartesian coordinates if say the points are $(r,\theta)$ where $r$ is the radius [$2$ dimensional]

cd is a euclidean distance between the centre of circle#1 (formed due to angles az(t,n),el(t,n) in space from transmitter t, at trial n and distance d away from origin) and circle#2 (formed due to angles az(r,n),el(r,n) in space from receiver r, at trial n and distance d away from origin)

-

1
It is difficult to understand what you are asking. – copper.hat Dec 10 '12 at 16:44
the centers of the circles are defines by angles say (theta, phi) I need to find out the distance between the centers of the 2 circles using cd=sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2) but I do not know what x, y and z are – Nidhi Dec 10 '12 at 16:45
but r1 and r2 are the radius. I have 2 angles as my center. will the formula still work? – Nidhi Dec 10 '12 at 16:49
my problem is 3 dimensional. :( – Nidhi Dec 10 '12 at 16:49
I am not sure I understand exactly what you are asking. What do you mean by saying that you have a circle given by $(\theta, \phi)$? – Thomas Dec 10 '12 at 16:50
show 3 more comments

## 1 Answer

In spherical coordinates, and generally in $\mathbb R^3$, it takes three coordinates to specify a point. If you only have $\phi, \theta$ you have a ray from the origin. You need the distance from the origin to get a point. Then, given $(r,\theta,\phi)$ for each point you can convert to Cartesian coordinates with $x=r \sin \theta \cos \phi, y=\sin \theta \sin \phi, z=r \cos \theta$

Added, based on your comment: The easiest is to erect a coordinate system at each transmitter. From transmitter 1, you know the point is at $(r_1,\theta_1,\phi_1)$, which you can convert to $(x_1,y_1,z_1)$. Then from transmitter 2, you know the vector is $(r'_2,\theta'_2,\phi'_2)$ where the primes indicate that the coordinate system is centered on transmitter 2. Hopefully your axes are aligned, that makes it easier. Convert this to $(x'_2,y'_2,z'_2)$, still referenced to transmitter 2. Then if transmitter 2 is at $(t2_x,t2_y,t2_z)$ in the transmitter 1 frame, the second point is at $(x'2+t2_x,y'_2+t2_y,z'_2+t2_z)$. Now you can use the usual Cartesian distance function.

-

No I have tried this but the problem is will r be the radius or the range. I have 2 different parameters. I'll try  to attach a figure – Nidhi Dec 10 '12 at 16:59
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 25, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.928616464138031, "perplexity_flag": "head"}