Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7885927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:11:37+00:00 2026-06-03T05:11:37+00:00

i want to convert x,y,z coordinates to polar coordinates. I am getting (-) in

  • 0

i want to convert x,y,z coordinates to polar coordinates. I am getting (-) in y coordiantes. Can someone explain me why I am getting it. It would be great help.

I am reading these values (xyz , az_elev_r) from a software and can’t be changed.I am just not sure of the order of angles( az & elev). Using my code I get -y instead of y. It means there is 180 rotation.My code is:

xyz=[-0.564 3.689 -0.735;
      2.011 5.067 -1.031;
     -1.181 3.943 -1.825; % Reference values
    ];

%% az_elev_r–>xyz

 az_elev_r=[ 261.30 -11.24 3.80;
               291.65 -10.692 5.548;
               253.34 -23.897 4.50]; % Also Reference (degree)



az_elev_r(:,1:2)=deg2rad(az_elev_r(:,1:2));

r=az_elev_r(:,3);
az=az_elev_r(:,1);
elev=az_elev_r(:,2);


x=r.*cos(az).*cos(elev)
y=r.*sin(az).*cos(elev)
z=r.*sin(elev)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:11:38+00:00Added an answer on June 3, 2026 at 5:11 am

    Your az_elev_r matrix is not consistent with your xyz reference.

    >> [az, el, r] = cart2sph(xyz(:,1), xyz(:,2), xyz(:,3));
    >> rad2deg(az)
    ans =
              98.6924675475501
              68.3527736950233
              106.673911589314
    

    Your answers are consistent with the values returned by the sph2cart function. (Example starts with your original input, before the dec2rad replacement.

    >> [x, y, z] = sph2cart(deg2rad(az_elev_r(:,1)), deg2rad(az_elev_r(:,2)), az_elev_r(:,3))
    x =
             -0.563766229670505
              2.01131973806906
             -1.17951822049783
    y =
             -3.68422880893852
             -5.06709019311118
             -3.94153436658676
    z =
             -0.740692730942158
             -1.02931719412937
             -1.82292172199717
    

    Incidentally, you’re code will be more readable if you just use the sph2cart function, and work in radians, unless you are trying to understand the conversions for their own sake.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Someone can explain me how to convert dialog box units to screen coordinates values
I want to convert a set of coordinates into polar coordinates (the easy part),
I want to convert mouse's current X and Y coordinates into the 3D space
Can I convert SVG image paths to Image map coordinates? Lets assume that I
I want to convert some point coordinates which are given in a cartesian system
Like this question states - I want to convert a click (2D) into coordinates
I can do this to convert a lat/lng to pixel coordinates in Google maps:
I want to convert British OSGB 36 co-ordinates to WGS 84 (i.e. standard latitude
I want to convert a string to formatted text in C# in WPF application,
I want to convert all the URLs in a javascript string to links, in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.