# 半径方向、トラック方向、2つのECEF座標と速度からのクロストラック成分（差）を計算する

``````r_1=[x_final;y_final;z_final] % first coordinate vector,  km
r_2=[x_ultra;y_ultra;z_ultra] % second coordinate vector, km

v_1=[vx_1;vy_1;vz_1] % velocities of first coordinates,km/sec
v_2=[vx_2;vy_2;vz_2] % velocities of second coordinates,km/sec
``````

``````ea_1=v_1/norm(v_1)                     % along direction unit vector of first point
ec_1=(r_1 x v_1)/norm(r_1 x v_1)     % cross-track direction unit vector of first point
er_1=ea_1 x ec_1                       % radial direction unit vector of first point

ea_2=v_2/norm(v_2)                     % along direction unit vector of second point
ec_2=(r_2 x v_2)/norm(r_2 x v_2)     % cross-track direction unit vector of second point
er_2=ea_2 x ec_2                       % radial direction unit vector of second point

% converting direction of unit vectors to distance (km)

radial_difference= norm((er_1*r_1)-(er_2*r_2)) % between first and second points, unit km
cross_difference=  norm((ec_1*r_1)-(ec_2*r_2)) % between first and second points, unit km
along_difference=  norm((ea_1*r_1)-(ea_2*r_2)) % between first and second points, unit km
``````

ベストアンサー