Results 1 to 2 of 2

Thread: Plotting locations on Matlab 3D sphere

  1. #1
      Tharsoum is offline
    Guild Novice
    Join Date
    Oct 2013
    Posts
    8

    Default Plotting locations on Matlab 3D sphere

    Well, I've a 250x3 matrix containing some geographic coordinates locations, where the first column represents the latitude (-90 to 90), the second one longitude (-180 to 180), and the third one is just the radius (for now, I'm not considering altitude, so it's the same value for all).

    I've tried creating a sphere, but I can't see how to plot the points on it. I've also just tried by plotting using sph2cart (for using this I made all latitudes and longitudes positive and running between 0 and 360) and then plot3. This option gives me a "sphere of points" with the correct radius, but wrong locations. Is possible to do this on Matlab?

    The code looks like this:

    superdat; % This is the 250x3 matrix of coordinates
    [datacbo datacba datacz]=sph2cart(superdat(:,1)*(pi/180),superdat(:,2)*(pi/180),superdat(:,3));
    plot3(datacbo,datacba,datacz,'*')

    Extra: a plot of the coordinates in 2D-Equirectangular projection

    Plotting locations on Matlab 3D sphere-ili_thar_-180_180.jpg
    Last edited by Tharsoum; 11-01-2013 at 08:28 PM.

  2. #2
      Hai-Etlik is offline
    Guild Expert Gracious Donor Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,121
    Blog Entries
    1

    Default

    Elevation is measured relative to one of the poles, not to the equator. You probably need to add a quarter turn to all your latitudes to get elevations.

Posting Permissions

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