Range and angle discrepancy with sph2cart transformation.

9 次查看(过去 30 天)
Hello everybody,
this is my problem/challenge. Given is the Radius (rng15), Azimut (phi15) and the Elevation (theta15) as root data of an object. It is beeing tracked from above at 7600m Altitude and and a speed of 190 m/s purely by the x-Axis.
After sph2cart transformation I have checked on the Azimut and Elevation angles as well the Range, and I found out that they dont meet / are not equal with the root data.
I would like to have your oppinion / advise about it.
Thank you.
The position and speed of the tracking device:
v0=190.46; % Speed of the tracking device, pure by the x-Axis
rngTime15= linspace(12.05, 34.03, 10000);
timeDiff15=(rngTime15-rngTime15(1));
r015 = timeDiff15.*v0;
xR15=r015; % Distance achieved from the device purele by the x-Axis
y015=zeros(1,10000);
rz015 = 25000/3.28084; % Altitude in meters now
z015=rz015.*ones(1,10000);
The Range of the object:
rng = [4.4 nan 4.3 4.2 4.1 nan 4.0 3.9 nan 3.8 3.7 3.6 nan 3.5 3.4 nan 3.3 ];
rng = rng.*1852; % rng NOW IN METERS
x = (1:17);
[rng,TF] = fillmissing(rng,'linear','SamplePoints',x);
rng15=imresize(rng,[1 10000], 'nearest');
rng15 = smoothdata(rng15);
The Elevation of the object:
theta = [-26 -27 -27 -28 -29 -29 -30 -30 -31 -31 -32 -33 -33 -34 -35 -35 -36];
theta15 = imresize(theta, [1 10000], 'nearest');
theta15=smoothdata(theta15);
theta15rad=deg2rad(theta15);
The Azimut of the object:
phi= [43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 58];
phi15 = imresize(phi, [1 10000], 'nearest');
phi15=smoothdata(phi15);
phi15rad=deg2rad(phi15);
The tranformation function:
[xt,yt,zt] = sph2cart(phi15rad,theta15rad,rng15);
These are the results I got after the execution, in which I checked the results with the root data:
theta1Check = rad2deg(atan(zt(1)/yt(1))); % -36deg
theta2Check = rad2deg(atan(zt(10000)/yt(10000)));% -39deg
phi1Check = rad2deg(atan(yt(1)/xt(1))); %44deg
phi2Check = rad2deg(atan(yt(10000)/xt(10000)));%57deg
rng15Check1 = sqrt(((xR15(1)-xt(1))^2)+((y015(1)-yt(1))^2)+((z015(1)-zt(1))^2)) ; % 1331m
rng15Check10000 = sqrt(((xR15(10000)-xt(10000))^2)+((y015(10000)-yt(10000))^2)+((z015(10000)-zt(10000))^2)) ; % 1210m
The Azimut angle seems to be correct. The Elevation angle (desired result round about between -26deg to -36deg) and range (desired result round about between 8000 and 6260) are not.
I also get negative results on the z-Axis which should not be possible, because it has been stated that the object should be above the ground.

采纳的回答

Raunak Gupta
Raunak Gupta 2020-5-29
编辑:Raunak Gupta 2020-5-29
Hi,
From the check code at the last I see the definition you have used to derive theta and range seems incorrect. Here is the correct formula which you can use to verify if the returned values are correct or not. For the negative value of zt since the elevation angle is negative and z is basically the radius multiplied with sine of elevation so it is coming out negative as per the given elevation angle. You may replace the last part of code with below one to verify the results.
theta1Check = rad2deg(atan(zt(1)/sqrt(yt(1).^2 + xt(1).^2)));
theta2Check = rad2deg(atan(zt(10000)/sqrt(yt(10000).^2 + xt(10000).^2)));
phi1Check = rad2deg(atan(yt(1)/xt(1)));
phi2Check = rad2deg(atan(yt(10000)/xt(10000)));
rng15Check1 = sqrt(xt(1)^2+yt(1)^2+zt(1)^2);
rng15Check10000 = sqrt(xt(10000)^2+yt(10000)^2+zt(10000)^2);
Hope this clarifies any doubts.
  1 个评论
Ali Faragallah
Ali Faragallah 2020-5-29
Thank you Raunak,
you defenitly helped me with the thetaCheck. I did not came up with the sqrt way of solution. My mistake with zt was actually to not lift up the result by the altitude which it was tracked on. It relatively demonstrated that the object was a certain amount below the tracking system. Thats why it plotted in the negative z-Axis. Using the result and "lifting" it up by the value of the tracking attitude concluded to the correct result.
Thank you for your help and have a nice week-end.

请先登录,再进行评论。

更多回答(0 个)

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by