Polar coordinates to spherical cartesian

Hi guys,

I may have bitten off more than I can chew at work. I measured a wireless device output signal at intervals around 360 degrees. I then rotated the router on a vertical axis and repeated the same. I now have 4 sets of polar coordinates (angle,distance) and I want to display this as a sphere if possible to show the effectiveness of the router. The only problem is researching shperical coordinates for a 3d shape need cartesian coordinates. I found a calclulator to assist the conversion ( Coordinate Converter ) and I had one set of coordinates by inputting 50 (metres) for r (radian?) at which all measurements were taken, and the angle for theta (0, 22.5,45, 67.5 etc and I know I should have used 30, 60, 90 but i'm no math whizz!). This gives me the coordinates for one set of 360 degrees which would create a ring I'm guessing. If I want the other 4 sets to be added then what do I do to the data? Effectively I have horizontal measurements, vertical measurements and 45 to 225 and 270 to 135 measurements in a 360 view of the router so the measurement plains look like an asterisk. I am just trying to find my feet as I was stupid enough to accept the challenge without much mathematical background. I'm not entirely sure how much sense this makes to anyone but any advice would be greatly appreciated.

Thanks.

Re: Polar coordinates to spherical cartesian

Hi, RevGav.

I can't say that I am entirely certain of what it is you're doing, but I think I have an idea of what's going on and decided to take a stab. To use spherical coordinates you need 3 pieces of information:

1. A radius (which it looks like for you is 50m)

2. An angle measured from the vertical axis

3. An angle measured in the horizontal plane

We write spherical coordinates using these three quantities in that order (radius, angle from vertical axis, angle measured in horizontal plane). For example, a data point from your first set of measurements in "spherical coordinates" might look something like

(50, 90, 22.5),

where 50 is the radius, the second coordinate is 90 degrees because your first measurements were taken in the horizontal plane which is at a 90 degree angle to the vertical axis, and 22.5 which is the angle measured in the horizontal plane that you provided in your data.

Again, I'm just trying to get in the ballpark of what you're getting at (I wouldn't put your reputation at work on the line for what I've said here). If I have misunderstood or made things more confusing let me know; maybe then we can nail down what you're looking to do. Otherwise, good luck!

Re: Polar coordinates to spherical cartesian

Firstly, many thanks for taking the time.

Secondly, I don't exactly have a great reputation to begin with, I was even laughed at for not splitting 90 degrees into 3 instead of 4. I just wanted to expand my horizons and tackle a new task.

What you've said makes a lot more sense. So those 3 coordinates are x, y and z (50, 90, 22.5) which seems perfectly logical to me. That gives me the horizontal 'ring' on the azimuth plane but then I lose confidence in my understanding. When I am trying to input the measurements taken for 225 degrees on a 2d polar plot would it be (50, 225, 45) or would it be (50, -45, 45) as it appears from my research cartesian coordinates are + or - 180 degrees? What you're saying makes a lot more sense than my explanations and I applaud your patience if none of this makes sense.

Thanks again.

1 Attachment(s)

Re: Polar coordinates to spherical cartesian

Attachment 24413First, congratulations on trying to push yourself. Unfortunately, this world seems to be filled with beings who are unsupportive of people trying new things. But if you keep pushing and teaching yourself you can do things you didn't think you could, you will probably be much happier than if you let opportunities to grow pass you by.

Now back to the math!

To begin, I want to mention that the 3 coordinates we discussed in the previous post are NOT x, y and z coordinates. I think the best way to see the difference between x, y z coordinates (which are called Cartesian Coordinates) and spherical coordinates is through examples.

Before we go to the examples the most important thing to understand is that BOTH x,y,z (Cartersian) coordinates and spherical coordinates are used to locate a point in 3 dimensions. What makes them different is how we measure them; much the same way that we can describe an amount of heat in degrees Fahrenheit or degrees Celsius. In the temperature example, a block of (water) ice is 32 degrees in the Fahrenheit system and 0 in the Celsius system. That doesn't mean the ice is "hotter" in the Fahrenheit system. Both temperature systems are describing the exact same thing, just in a different way. And so it is with Cartesian vs. spherical coordinates, they both describe points in 3 dimensional space, just in different ways.

Now take a look a the picture I've attached. Let's start with the red point.

The Cartesian coordinates (meaning x, y and z) of the red point are (0, 0, 4). The first 0 is because we didn't move at all in the x direction, the second 0 is because we didn't move in the y direction, and the 4 comes from the need to move 4 units in the z direction.

Now the spherical coordinates of the red point are (4, 0, 0). Remember that in spherical coordinates we have (radius, angle from vertical, azimuth angle). So, in this case, the first 4 is the distance from the point to the origin (i.e. it's the radius to the red dot. Now the zero in the second spot comes from the fact that the point sits on the vertical axis, so its angle from the vertical axis is zero. The zero in the third spot comes from the fact that our azimuth angle is also zero.

Now let's try the green dot.

The Cartesian (x, y, z) coordinates for the green dot are (0, 2, 0). If you're unsure of this ask and I will explain further.

The spherical coordinates for the green dot are (2, 90, 90). The 2 comes from the fact that the green dot is 2 units from the origin. The first 90 comes from the angle we must bend from the vertical axis to get to the green dot. The second 90 comes from the angle we must bend from the x-axis (the azimuth) to get to the green dot.

So we see that (0, 2, 0) in Cartesian coordinates and (2, 90, 90) in spherical coordinates describe the same point in three dimensions - just like 32F an 0C describe the same temperature.

We went through all of the above because in the previous post it was mentioned that "those 3 coordinates are x, y and z (50, 90, 22.5)." Those 3 are NOT x, y and z, those 3 are the spherical coordinates.

Does that help seeing what is meant by Cartesian vs. spherical coordinates?

Take a look at the first picture at Spherical coordinate system - Wikipedia, the free encyclopedia. This is a nice picture showing how spherical coordinates are measured in general.

Technical Note: We should be using radians when we use spherical coordinate, but I have ignored this and used degrees above because they seem to be more comfortable to work with at the moment.

Re: Polar coordinates to spherical cartesian

Crikey, I thought I was ok when i got my head around spherical coordinates but it seems cartesian is a whole new ball game. I have to use cartesian due to the software (matlab) I have licence for needing x,y,z for the data. I tried converting the spherical coordinates for (50,90,22.5) into cartesian with the online calculator and get (46.19, 19.13, 3.062e-15) that last number baffles me so I'm even worse at all this than I thought. Radians is degrees x pie over 180 isn't it? So if that is the case does it remain as 50 for the metres and then convert 90 and 22.5 into radians? If so, google calc gave me (50, 0, 0.392699082) which is again different to the cartesian coordinates that the other calc gave me. I'm obviously doing it quite wrong to get such differing results.

thanks ever so much for your detailed answers by the way, I'm sorry they're not as successful as they may be if I knew what on earth I was doing properly.