+ Reply to Thread
Results 1 to 4 of 4

Plotting Lines Based on Their Course

  1. #1
    Registered User
    Join Date
    12-14-2023
    Location
    Denmark
    MS-Off Ver
    Google Sheets
    Posts
    5

    Plotting Lines Based on Their Course

    Hello everyone,

    I'm trying to create a chart that visually represents a ship's course, along with the effects of wind and sea on its direction. The goal is to plot the ship's trajectory and display how external factors influence its movement.

    I've come across two separate spreadsheets that, together, could help me achieve this. However, I've run into a few issues:
    • One of the sheets is too complex to upload to Google Sheets.
    • The other lacks some key features found in the first sheet.

    Attached are the relevant files for reference.

    Here's what I'm ultimately aiming for:
    • A circular chart displaying degrees.
    • A visual representation of the ship's course.
    • The ability to add lines indicating wind and sea angles relative to the ship.


    Any advice or guidance would be greatly appreciated!
    Attached Files Attached Files

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

    Re: Plotting Lines Based on Their Course

    Am I correct in assuming that this must be done in Google Sheets and not Excel?

    I can see that you found my unit circle spreadsheet. You are correct that this should provide a nice template for a "vector diagram," but I'm not sure how well it will export to Google Sheets. I have usually found that charts made in Excel don't export to other spreadsheets very well. In my experience with charts in spreadsheets, it is best to create the chart in the spreadsheet app that you need.

    I'm not very familiar with Google Sheets chart engine. I could not see a way to get multiple x,y data series in the chart, so I ended up making one single data series in a line chart. The basic idea is to start at one point in the diagram (I started at the origin) then draw the lines without lifting your "pencil." I was able to figure out a basic 3 vector vector diagram by:

    1) First I set up one row to convert polar coordinates to rectangular coordinates, since this is the basic calculation behind everything.
    1a) In A5 I enter a radius/magnitude, in B5 I enter an angle (I'm assuming you would want to enter the angle in degrees).
    1b) In C5, I calculate the corresponding x coordinate =r*sin(theta) =A5*SIN(RADIANS(B5)).
    1c) In D5, I calculate the corresponding y coordinate =r*cos(theta) =A5*COS(RADIANS(B5)).
    2) Select A5:D5 and copy down as far as needed. I decided to calculate the circle every 10 degrees, so I copied down to row 46, with 6 points to calculate and draw 3 vectors.
    3) Start drawing at r=0, theta=0, in A5 and B5.
    4) In A6, B6, enter the r and theta for the first vector.
    5) In A6 and B6, enter r=0 and theta =0 again.
    6) In A7 and B7, enter the r and theta for the second vector
    7) A8=0, B8=0
    8) A9=r, B9=theta for third vector.
    9) A10=r for third vector. B10=B9+10
    10) Select A10:B10 and copy down to the end of the list (row 46 in my case).
    11) Select C5:D46 and insert your line chart.
    12) Edit the chart to format the three vector points with a unique marker so that you can see which vector is which.

    From there, I'm not sure what to recommend, but that should give you the beginnings of a vector diagram to show your boat's bearing, along with vectors to represent wind and wave motion.

    Is that going to be even close to what you want?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    12-14-2023
    Location
    Denmark
    MS-Off Ver
    Google Sheets
    Posts
    5

    Re: Plotting Lines Based on Their Course

    Hello MrShorty,

    Thanks for your feedback.

    I think I'm close to something that could work.

    Firstly, could you check if this is what you imagined -> https://docs.google.com/spreadsheets...it?gid=0#gid=0

    I had some issues here:

    4) In A6, B6, enter the r and theta for the first vector.
    5) In A6 and B6, enter r=0 and theta =0 again.


    I guess you meant A7 and B7 for point 5).

    As it is right now, vector 3 determines the magnitude of the circle what can cause the other vectors to go over the circle.
    Last edited by AliGW; 09-25-2024 at 04:43 AM. Reason: URL fixed & moved to the Other Platforms section.

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

    Re: Plotting Lines Based on Their Course

    That is pretty much exactly what I imagined, in spite of my typos, that you were able to correct.

    You are correct that I chose to use vector 3 to determine the radius of the circle. If you want to use a different value for the radius, enter/calculate the desired radius in A11:A46. That will leave you with a line connecting the end of the 3rd vector with the starting point of the circle. I don't know enough about Google's chart engine to know off the top of my head how to fix that (assuming it is even a problem).

    The other change I might make is put a MOD(B10+10,360) in B11 (copy down) so that the bearing will always be between 0 and 360. A bearing of 405 is technically correct, but someone somewhere is going to get irritated seeing a bearing that is outside of 0 to 360.

+ 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. Values i want on the X and Y axis are plotting as 2 lines
    By rach1995 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-11-2023, 02:26 AM
  2. Plotting Formulas and showing gaps in the lines
    By rwmill9716 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-16-2016, 12:25 PM
  3. [SOLVED] Plotting Vertical Lines on chart at given 'Time Values'
    By chaitreya in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-24-2015, 06:32 AM
  4. [SOLVED] Plotting contour lines
    By lnash in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2013, 09:44 PM
  5. Plotting multiple lines on a graph with different x values
    By freedom4horses in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2011, 04:27 PM
  6. Plotting 2 bars and 2 lines in a 2 y-axis graph
    By patricia.junkes in forum Excel General
    Replies: 2
    Last Post: 07-08-2011, 03:33 AM
  7. Plotting 2 lines on a line graph
    By andrewsco in forum Excel General
    Replies: 2
    Last Post: 09-10-2010, 09:27 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