Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / June 2006

Tip: Looking for answers? Try searching our database.

Visually add (graph) vectors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Banaticus - 26 Jun 2006 18:21 GMT
I'd like to visually add (graph) vectors, up to three of them.  I'
prefer to simply add them as polar coordinates, although I can easil
convert them to rectangular coordinates.  I'd like Excel to graph on
vector after another, adding the tail of each vector to the head of th
previous vector (or the origin).  At the end, I'd like Excel to draw
vector from the origin of the graph to the head of the last vector an
give the resulting polar coordinates (converting as required).  In th
following table I show how I'd like to format the initial pola
coordinates -- it also shows the calculated x/y end points for the sam
line stretching from the origin.  I have four vectors in this sampl
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.809
-------------------

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 - 27 Jun 2006 15:40 GMT
Check out this attachment -- I'm looking to add arrowheads to the points
and change the color of the final line (the resultant).

+-------------------------------------------------------------------+
|Filename: lab 3.zip                                                |
|Download: http://www.excelforum.com/attachment.php?postid=4944     |
+-------------------------------------------------------------------+

Signature

Banaticus

Jon Peltier - 30 Jun 2006 05:49 GMT
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
_______

> 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
[quoted text clipped - 26 lines]
> 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))
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.