+ Reply to Thread
Results 1 to 3 of 3

Visually add (graph) vectors

  1. #1
    Registered User
    Join Date
    06-26-2006
    Posts
    44

    Visually add (graph) vectors

    I'd like to visually add (graph) vectors, up to three of them. I'd prefer to simply add them as polar coordinates, although I can easily convert them to rectangular coordinates. I'd like Excel to graph one vector after another, adding the tail of each vector to the head of the previous vector (or the origin). At the end, I'd like Excel to draw a vector from the origin of the graph to the head of the last vector and give the resulting polar coordinates (converting as required). In the following table I show how I'd like to format the initial polar coordinates -- it also shows the calculated x/y end points for the same line stretching from the origin. I have four vectors in this sample table just so that I can check my x,y calculations.
    Please Login or Register  to view this content.
    The code for the Ref Angle on the first line is:
    =IF(B3<90,B3,IF(B3<=180,180-B3,IF(B3<=270,B3-180,IF(B3<=360,360-B3,"ERR"))))

    The code for x on the first line is:
    =IF(OR(B3<90,B3>270),ROUND(A3*COS(RADIANS(C3)),4),ROUND(A3*COS(RADIANS(C3))*-1,4))

    The code for y on the first line is:
    =IF(B3<180,ROUND(A3*SIN(RADIANS(C3)),4),ROUND(A3*SIN(RADIANS(C3))*-1,4))

  2. #2
    Registered User
    Join Date
    06-26-2006
    Posts
    44
    Got it -- the x/y scatter chart uses two series so that the resultant can be in a different color and line weight. Any questions/comments, please send them to my user name on this forum @gmail.com
    Attached Files Attached Files
    Last edited by Banaticus; 06-27-2006 at 12:55 PM.

  3. #3
    Jon Peltier
    Guest

    Re: Visually add (graph) vectors

    You might be able to adapt this approach to your project:

    http://peltiertech.com/Excel/Charts/VBAdraw.html

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______


    "Banaticus" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I'd like to visually add (graph) vectors, up to three of them. I'd
    > prefer to simply add them as polar coordinates, although I can easily
    > convert them to rectangular coordinates. I'd like Excel to graph one
    > vector after another, adding the tail of each vector to the head of the
    > previous vector (or the origin). At the end, I'd like Excel to draw a
    > vector from the origin of the graph to the head of the last vector and
    > give the resulting polar coordinates (converting as required). In the
    > following table I show how I'd like to format the initial polar
    > coordinates -- it also shows the calculated x/y end points for the same
    > line stretching from the origin. I have four vectors in this sample
    > table just so that I can check my x,y calculations.
    >
    > Code:
    > --------------------
    > Vectors
    > Mag Angle Ref Ang x y
    > 100 50 50 64.2788 76.6044
    > 150 170 10 -147.7212 26.0472
    > 50 185 5 -49.8097 -4.3578
    > 50 275 85 4.3578 -49.8097
    > --------------------
    >
    >
    > The code for the Ref Angle on the first line is:
    > =IF(B3<90,B3,IF(B3<=180,180-B3,IF(B3<=270,B3-180,IF(B3<=360,360-B3,"ERR"))))
    >
    > The code for x on the first line is:
    > =IF(OR(B3<90,B3>270),ROUND(A3*COS(RADIANS(C3)),4),ROUND(A3*COS(RADIANS(C3))*-1,4))
    >
    > The code for y on the first line is:
    > =IF(B3<180,ROUND(A3*SIN(RADIANS(C3)),4),ROUND(A3*SIN(RADIANS(C3))*-1,4))
    >
    >
    > --
    > Banaticus
    > ------------------------------------------------------------------------
    > Banaticus's Profile:
    > http://www.excelforum.com/member.php...o&userid=35795
    > View this thread: http://www.excelforum.com/showthread...hreadid=555681
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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