rotate polygon in geographic axes
Ältere Kommentare anzeigen
I have a n-sided polygon with vertices as (lat,lon) coordinates. I plot this on a geographic axes. I want to rotate it and end up with a new rotated set of (lat,lon) coordinates. I don't want a filled polygon, but perhaps I could adjust the transparency if that's the only way (such as patch). Here is what I tried, but not sure it works accurately due to the oblate earth surface. I prefer not to use Mapping Toolbox, but just core Matlab.
geoplot(lat,lon,'k-')
polyin = polyshape([lat',lon']);
refPoint = [refLat, refLon];
polyout = rotate(polyin, angleDeg, refPoint);
lat = [polyout.Vertices(:,1); polyout.Vertices(1,1)];
lon = [polyout.Vertices(:,2); polyout.Vertices(1,2)];
geoplot(lat,lon,'b--')
1 Kommentar
Mike D.
am 12 Jul. 2024
Antworten (1)
Pujitha Narra
am 24 Feb. 2020
0 Stimmen
Hi Mike,
A rotation matrix might be of use to you. You can have a look at this: https://www.mathworks.com/matlabcentral/answers/296860-rotating-a-2d-shape
1 Kommentar
Mike D.
am 12 Jul. 2024
Kategorien
Mehr zu Create Plots on Maps finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!