Path radius from lat/long data
36 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am working on computing the approximate radius of curvature of a road. I have lat/long coordinates for points along the path, and I'd like to estimate the circular radius between two points that are maybe 25m apart. My data is taken at about 1m intervals.
I've been using a lot of homemade functions to do this, and now I have the Mapping Toolbox, which appears to have a lot more options for the calculations.
Any help would be greatly appreciated.
0 Commenti
Risposte (4)
Sean de Wolski
il 6 Set 2012
A place to start:
We might be able to be of more assistance if you gave us sample values and expected results etc...
Babak
il 6 Set 2012
Modificato: Babak
il 6 Set 2012
It depends your data are in 2D (x-y plane) or 3D (xyz plane).
There are equations to find the radius of curvature for each case. For example for 2D data if you have a function y=f(x), or sampled data points from this function, the radius of curvature at any point x0, is mathematically proven to be:
rho = abs(1+f'(x0)^2))^(1.5)/abs(f"(x0))
where f'(x0) and f"(x0) are the first and second derivative of the function at the point of interest.
Now, if I were in your shoes, I would try to find a "finite difference approximation" for these derivatives with the data I have and use the above equation to find the radius of curvature.
Offcourse, if your data are in 3D you need to use the proper equation. See
for more details.
Babak
il 6 Set 2012
Modificato: Babak
il 6 Set 2012
You must be using the geographical coordinate system. It is same as the spherical coordinates. Here is the transformation to Cartesian coordinates:
x = r*sin(theta)*cos(phi)
y = r*sin(theta)*sin(phi)
z = r*cos(phi)
where theta is the angle of inclination from the plane of reference. So you have a bunch of theta and phi angles. You can use the above transformation and find a whole bunch of (x/r,y/r,z/r) = (a,b,c) data. You have the cord distance between two points of (x1,y1,z1) and (x2,y2,z2) and need to compute the arc distance btween these two points. The cord distance (25m) between the points you have is
d_cord_12 = sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2)
By factorizing r you can write
(x1,y1,z1) = r1*(a1,b1,c1)
and
(x1,y1,z1) = r2*(a2,b2,c2)
If the points are close to each other you can estimate r1=r2=r and reduce the d_cord_12 equation to
d_cord_12 = r * sqrt((a1-a2)^2+(b1-b2)^2+(c1-c2)^2)
by having (a1,b1,c1) and (a2,b2,c2) and d_cord_12 you can compute r as
r = d_cord_12 / sqrt((a1-a2)^2+(b1-b2)^2+(c1-c2)^2)
0 Commenti
Star Strider
il 7 Set 2012
Modificato: Star Strider
il 8 Set 2012
I'm not sure there is a completely built-in way to get the distances along the road you are interested in, but this seems to produce [x y z] in meters, since the results of [xchk ychk zchk] — delivering a y value of 60 nautical miles per degree longitude at the equator — appear to be accurate and appropriate. I used sph2cart in these calculations. I named your data array AzEl here:
d2r = @(a) pi*a/180;
ka = 6378.1370; % Equatorial radius (km)
kb = 6356.7523; % Polar radius (km)
a = ka*1000;
b = kb*1000;
phi = d2r(AzEl(:,1));
R = sqrt(((a^2*cos(phi)).^2 + (b^2*sin(phi)).^2) ./ ((a*cos(phi)).^2 + (b*sin(phi)).^2)); % Radius at geodedic latitude (phi)
Rm = median(R);
[xchk ychk zchk] = sph2cart(d2r(1), d2r(0), a);
ynm = ychk/1852; % Convert from meters to nautical miles
[x y z] = sph2cart(d2r(AzEl(:,2)), d2r(AzEl(:,1)), Rm);
A further check indicates the median of DistVct — the vector of distances between your road data points — to be about 1.193 meters:
DifMtx = [diff(x) diff(y) diff(z)];
DistVct = hypot(DifMtx(:,2), DifMtx(:,3));
If this does what you want it to do, you can code it as a function, providing an almost-built-in capability.
0 Commenti
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!