+ Reply to Thread
Results 1 to 11 of 11

Polar to cartesian convert with function

  1. #1
    Registered User
    Join Date
    02-04-2016
    Location
    Finland
    MS-Off Ver
    2013
    Posts
    5

    Polar to cartesian convert with function

    Hi to all,

    I have a problem with converting polar coordinates with cartesian points and back.

    The issue is to find cartesian coordinate in 0,0 origin based chart. Lets say that I have plot in 50,50 and I would like to find another cartesian plot from that point with angle and distance in polar coordinates for example (angle 180: distance: 10)

    Correct plot should be (50,40)

    Function now uses cartesian orientated angles.

    Please Login or Register  to view this content.
    I can get correct plot with VLOOKUP to determine correct cartesian angle. For example polar angle 10 returns 80.

    I would really appreciate some help to add code in function to determine angle conversion without VLOOKUP.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Polar to cartesian convert with function

    Correct plot should be (50, 40) or (40, 50)...? I'm assuming 0 degrees is from the origin and extending along the positive x-axis and thus your answer would be (40, 50). This confusion may be tied to your statement of converting cartesian angles to polar angles. I don't know what you mean by a cartesian angle since the cartesian system uses points.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,427

    Re: Polar to cartesian convert with function

    Can you upload your spreadsheet so we can see how you are using these functions? Can you be sure to include an example of incorrect results? I cannot recreate your erroneous values based on what you have posted, and the functions seem to work correctly for me.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    02-04-2016
    Location
    Finland
    MS-Off Ver
    2013
    Posts
    5

    Re: Polar to cartesian convert with function

    Thank you Gentleman for your answers,

    At this point I don't have any spreadsheet to show you. I have just faced this problem so many times, and tried to find solution for ages...

    Correct answer should be 50,40 because with 180 I want to go down (south) 10 and stay in the same x-axis. Now excel goes 10 to left, because x-axis is 0-180 degree orientated from origin.

    So just to clarify I want to use navigational bearings from point to point. N=000,E=090,S=180,W=270

    Now excel uses cartesian standard: E=0,N=090,W=180,S=270

    Than you...

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,427

    Re: Polar to cartesian convert with function

    Now I understand. You are trying to show compass bearings and distances. Two things have to happen with compass bearings:

    1) Standard reference for polar coordinates is the positive x axis (going right). Reference for bearings is north (vertical). So to convert bearings to polar, we need to rotate the angle 90 degrees CCW (pi/2 radians).
    2) Polar angles increase CCW. Bearing angles increase CW, so we need to invert the "direction" of the angles.

    I think this should be a simple rotation/inversion operation: polarangle=90-bearingangle
    or in your function:
    Please Login or Register  to view this content.
    Last edited by MrShorty; 02-04-2016 at 01:27 PM.

  6. #6
    Registered User
    Join Date
    02-04-2016
    Location
    Finland
    MS-Off Ver
    2013
    Posts
    5

    Re: Polar to cartesian convert with function

    Thank you MrShorty,

    90- is the trick for this... I'm feeling bit stupid right now, I have been thinking my head off this so called problem...

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,427

    Re: Polar to cartesian convert with function

    If that helped, and you feel you should become more proficient in this sort of thing, I would suggest that you spend some time to become more proficient in using and understanding the unit circle. IMO, the unit circle is often the easiest "model" for understanding and visualizing basic trig concepts like this. If it helps, I posted a spreadsheet to illustrate properties of the unit circle and basic trig functions: http://www.excelforum.com/tips-and-t...ml#post4291629

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Polar to cartesian convert with function

    For compass headings (i.e., angle a in radians measured CW from +y),

    x = d*sin(a)

    y = d*cos(a)

    a = atan2(y, x)
    Last edited by shg; 02-04-2016 at 04:31 PM.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Polar to cartesian convert with function

    For anyone who finds it useful,

    Row\Col
    A
    B
    C
    D
    E
    F
    1
    direction
    from
    function
    x
    y
    Remarks
    2
    CCW +x = ATAN2(x, y)
    COS(Θ)
    SIN(Θ)
    Classic trig
    3
    CCW +y = ATAN2(y, -x)
    -SIN(Θ)
    COS(Θ)
    4
    CCW -x = ATAN2(-x, -y)
    -COS(Θ)
    -SIN(Θ)
    5
    CCW -y = ATAN2(-y, x)
    SIN(Θ)
    -COS(Θ)
    6
    CW +x = ATAN2(x, -y)
    COS(Θ)
    -SIN(Θ)
    7
    CW +y = ATAN2(y, x)
    SIN(Θ)
    COS(Θ)
    Compass (East-North-Up)
    8
    CW -x = ATAN2(-x, y)
    -COS(Θ)
    SIN(Θ)
    9
    CW -y = ATAN2(-y, -x)
    -SIN(Θ)
    -COS(Θ)
    Compass reciprocal

  10. #10
    Registered User
    Join Date
    01-11-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Polar to cartesian convert with function

    Quote Originally Posted by shg View Post
    For anyone who finds it useful,

    Row\Col
    A
    B
    C
    D
    E
    F
    1
    direction
    from
    function
    x
    y
    Remarks
    2
    CCW +x = ATAN2(x, y)
    COS(Θ)
    SIN(Θ)
    Classic trig
    3
    CCW +y = ATAN2(y, -x)
    -SIN(Θ)
    COS(Θ)
    4
    CCW -x = ATAN2(-x, -y)
    -COS(Θ)
    -SIN(Θ)
    5
    CCW -y = ATAN2(-y, x)
    SIN(Θ)
    -COS(Θ)
    6
    CW +x = ATAN2(x, -y)
    COS(Θ)
    -SIN(Θ)
    7
    CW +y = ATAN2(y, x)
    SIN(Θ)
    COS(Θ)
    Compass (East-North-Up)
    8
    CW -x = ATAN2(-x, y)
    -COS(Θ)
    SIN(Θ)
    9
    CW -y = ATAN2(-y, -x)
    -SIN(Θ)
    -COS(Θ)
    Compass reciprocal

    Hi,
    Do you have table for 3D coordinates? X,Y,Z

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Polar to cartesian convert with function

    Quote Originally Posted by B_Siva View Post
    Hi,
    Do you have table for 3D coordinates? X,Y,Z
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cartesian Macro help!
    By katich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2014, 08:57 AM
  2. Generate a Cartesian spreadsheet
    By Geekgurl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-13-2013, 02:10 AM
  3. Polar curve plotted in polar chart
    By Rocky2013 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 11-05-2013, 10:45 AM
  4. How to enter Cartesian equation
    By mperata in forum Excel General
    Replies: 7
    Last Post: 07-09-2012, 11:14 PM
  5. Charting using Polar Coordinates (r,φ) instead of XY Cartesian
    By XcelGirl in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-01-2007, 05:25 PM
  6. Cartesian chart
    By Zekni in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-13-2006, 08:15 PM
  7. convert from rectangualr to polar
    By Alfy in forum Excel General
    Replies: 9
    Last Post: 03-02-2006, 09:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1