Non-standard spherical coordinates conversion

Hi, I have imported antenna data from CST Microwave Studio, with theta and phi spherical coordinate vectors. However, I noticed the phi vector ranges from -180 to 180 and the theta vector from 0 to 179, which is not the standard spherical coordinate system where phi is [0 180] and theta [0 360]. Is there any conversion function implemented for different conventions?
As an example in my case: phi = -90 and theta = 0 corresponds to the negative X axis. In standard coordinates that point would be expressed by phi = 90 and theta = 180

5 commentaires

Matt J
Matt J le 7 Mar 2023
I have never seen a convention having the phi coordinate run over 360 degrees.
I would recommend using the terminology (radial, azimuthal, and polar) here, rather than referring solely by the Greek letters. Unfortunately, there are several conflicting conventions. See, e.g. this MathWorld page.
@Albert Zurita, can you recast your question using this terminology, and confirm which coordinates vary over which ranges (and then what you want)? The conversion should be trivial, once fully understood.
Uploading your data (or at least a representative sample) would also be handy.
@Matt J@the cyclist thanks for your suggestions, I have changed the nomenclature and included a reference to Wikipedia for the standard definition of angles.
My data:
phi -> -180 to 180
theta -> 0 to 179
I want to convert to standard ranges:
phi -> 0 to 180
theta -> 0 to 360
I understand how you want the final coordinates to be. (You are calling this "standard", but the Wikipedia page acknowledges that there are multiple conventions used. There is no single standard.) But let's confirm:
  • phi denotes the polar angle, measured downward from the positive Z axis. It ranges from 0 to 180.
  • theta denotes the azimuthal angle, measured from the positive X axis, toward the positive Y axis.
  • 0 = pos X axis
  • 90 = pos Y axis
  • 180 = neg X axis
  • 270 = neg Y axis
I cannot figure out the coordinate system you are converting from, based on what you have stated. Can you use the same method I just did above, to describe the angles denoted by phi and theta?
Hi Albert,
given the ranges of the CST phi and theta, the only sensible concusion is that the CST theta is your phi (polar angle) and the CST phi is your theta (azimuthal angle). Since CST theta goes from 0 to 180, it's reasonable to conclude that that angle is measured down from the north pole, (+z axis usually). For CST phi, which goes from -180 to 180, it's likely that phi = 0 is the +x axis with positive azimuthal angle measured counterclockwise from there. All of this is very much one of the standard conventions, subject to verification that you may have to obtain in some way.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Polar Plots dans Centre d'aide et File Exchange

Produits

Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by