Geographical points + great circle = ellipse? (Matlab)

In summary: If the ellipse is still there it means the data is still distorted in some way. If the ellipse is gone then it means the data is correctly represented and you can safely stop looking for the problem.
  • #1
MartinV
69
0
I'm doing this in Matlab but it's not restricted to any particular software.

I have a bunch of geographical points (x,y coordinates for each) and I want to take all the points that are 50 km or closer to the reference point. I took the great-circle equation to convert geographical longitude and latitude into angular distance which I can then multiply with Earth's radius and I'm done.

The thing is when I plot all the points that are supposed to be 50 km away or closer to my center (and make sure both axis have the same scale by typing "axis equal"), the points make out an ellipse, not a circle. I rechecked the code and everything seems fine. I made double sure by drawing a circle on top of my plot and yes, some points stick out on the sides.

Do you guys have any idea what could cause this? I was thinking of maybe the data being distorted due to Earth's curvature but the data was collected from the Earth's surface, not from a satellite.


Here's my code that takes the events and sorts them according to their range:

function B = handBag(ref,A,R) %A is the main dataset, R radius, ref reference point

B = [];

for i = 1:length(A)
if (ang(ref,A(i,:)) <= R/6371)
B = [B; A(i,:)];
end
end

end

function y = ang(A,B) %calculates the angle difference between two points

yy = sin(A(2)*pi/180) *sin(B(2)*pi/180) + cos(A(2)*pi/180) *cos(B(2)*pi/180) ...
*cos(-1*(A(1)-B(1))*pi/180);

y = acos(yy);
end
 
Physics news on Phys.org
  • #2
Create a small list of data points that you are ABSOLUTELY certain are all exactly 49 km from the center and are roughly uniformly positioned around the center. Use those with your software and see if they are all neatly a circle just inside your existing circle. Don't just "use your own code backwards" to generate these points because that could more easily just reproduce whatever errors you might already have, find some completely different independent way of getting these that you can be certain is correct.

If they are also an ellipse that tells you one thing. If some are inside and some are outside your circle that tells you something different.

Done right this should help you narrow down where the problem is by at least half.
 
  • #3
It turned out the problem was this:
https://en.wikipedia.org/wiki/Equirectangular_projection

The function I used to draw my circle on top of my points was this:

function [x,y] = circle(x0,y0,r)

alpha = 0:0.01:2*pi;
x = x0 + r/6371*180/pi *cos(alpha);
y = y0 + r/6371*180/pi *sin(alpha);
plot(x,y,'b-');
end

I changed it into this:

function [x,y] = circle(x0,y0,r)

alpha = 0:0.01:2*pi;
x = x0 + r/6371*180/pi *cos(alpha) /cosd(y0);
y = y0 + r/6371*180/pi *sin(alpha);
plot(x,y,'b-');
end
 

Related to Geographical points + great circle = ellipse? (Matlab)

1. What is a great circle in terms of geographical points?

A great circle is a circle formed on the surface of a sphere by the intersection of the sphere and a plane that passes through the center of the sphere. In terms of geographical points, a great circle is the shortest distance between two points on the surface of the Earth.

2. How is a great circle different from a small circle?

A great circle is the largest possible circle that can be drawn on a sphere, while a small circle is any other circle on the surface of the sphere. A great circle divides the sphere into two equal halves, while a small circle does not.

3. How is an ellipse related to geographical points and great circle?

An ellipse is a type of curve that is formed when a plane intersects a cone or a cylinder at an angle. When a great circle is projected onto a flat surface, it appears as an ellipse. This is because the Earth is not a perfect sphere, but rather an oblate spheroid, which means it is slightly flattened at the poles.

4. How can Matlab be used to calculate the properties of an ellipse formed by geographical points and great circle?

Matlab is a powerful software program that can be used to perform complex calculations and data analysis. It has built-in functions and tools that can be used to calculate the properties of an ellipse, such as its eccentricity, semi-major and semi-minor axes, and the angle of rotation.

5. Can the concept of geographical points and great circle be applied to other planets?

Yes, the concept of great circles and ellipses can be applied to other spherical objects, such as other planets or moons. However, the properties of these shapes may differ depending on the size and shape of the object. For example, the Earth's moon has a much more pronounced elliptical orbit compared to the Earth's orbit around the sun.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
581
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
905
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
Replies
4
Views
846
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
969
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Back
Top