Parent Directory
|
Revision Log
|
Revision Graph
o Initial check in.
| 1 | function [X] = longitude(x) |
| 2 | % X=longitude(x); |
| 3 | % |
| 4 | % tries to determine best range of longitude (e.g. -180<180 or 0<360) |
| 5 | % so that coordinate (x) doesn't span a discontinuity. |
| 6 | % |
| 7 | |
| 8 | % also works for radians which are assumed if range of x<=2*pi |
| 9 | |
| 10 | minx=min(min(min(x))); |
| 11 | maxx=max(max(max(x))); |
| 12 | %if maxx-minx < 2.2*pi |
| 13 | % units=180/pi; |
| 14 | %else |
| 15 | units=1; |
| 16 | %end |
| 17 | minx=min(min(min(x*units))); |
| 18 | maxx=max(max(max(x*units))); |
| 19 | |
| 20 | X=mod(720+x*units,360); |
| 21 | maxP=max(max(max(X))); |
| 22 | minP=min(min(min(X))); |
| 23 | |
| 24 | XX=mod(X+180,360)-180; |
| 25 | maxM=max(max(max(XX))); |
| 26 | minM=min(min(min(XX))); |
| 27 | |
| 28 | if maxP-minP > maxM-minM |
| 29 | X=XX; |
| 30 | end |
| ViewVC Help | |
| Powered by ViewVC 1.1.22 |