absolute position (Stars use this) The atbFlatten command may be used to easily extract a given field of a geometry structure array. SEE ALSO atbFlatten EXAMPLE Assume the user has generated two aircraft, ac1 and ac2 with overlapping time intervals. try the following commands: minTime = max([min(ac1.dynState.times) min(ac2.dynState.times)]); maxTime = min([max(ac1.dynState.times) max(ac2.dynState.times)]); times = linspace(minTime, maxTime); geom = atbGeometry(times, ac1.dynState, ac2.dynState); pos = atbFlatten(geom,'pos'); lla = atbCbfToLla(geom(1).cb, pos); lat = lla(1,:); long = lla(2,:); plot(long*180/pi, lat*180/pi, '+'); vel = atbFlatten(geom, 'vel'); relPosCBF = atbFlatten(geom, 'relPos'); len = max(size(geom)); az = zeros(1, len); el = zeros(1, len); for k=1:len relPosVVLH = atbCbfToVvlhMtx(pos(:,k), vel(:,k)) ... * relPosCBF(:,k); az(k) = atan2(-relPosVVLH(2), relPosVVLH(1)); el(k) = pi/2 - acos(relPosVVLH(3)/norm(relPosVVLH)); end figure; plot(az*180/pi, el*180/pi, '+'); 3.6.2 atbGenGreatArc 作用:compute great arc route 用法:llaPos = atbGenGreatArc('cb', fromLLA, toLLA, angRes) 说明:cb - central body name fromLLA - 3x1 LLA vector [rad;rad;meters]. toLLA - 3x1 LLA vector [rad;rad;meters]. angRes - angular resolution (rad) llaPos - 3xN LLA vector of intermediate points 3.6.3 atbCreateDynStateCBF 作用:Create a dynState structure from CBF data elements 用法:dynState = atbCreateDynStateCBF('cb', posVelTimes, cbfPos, cbfVel, quatTimes, cbfQuat, angVel) dynState = atbCreateDynStateCBF('cb', posVelTimes, cbfPos, cbfVel, quatTimes, cbfQuat) 说明:cb - valid central body name, i.e. 'earth' posVelTimes - 1xN length time array for pos and vel data cbfPos - 3xN CBF position array [x;y;z] (meters) cbfVel - 3xN CBF velocity array [vx;vy;vz] (m/sec) quatTimes - 1xM time array for attitude data cbfQuat - 4xM attitude quaternion array representing the rotation from the CBF frame to the objects body axes frame angVel - optional 3xM angular velocity array representing the rotation rate around each body frame axis [rx;ry;rz] (rad/sec). The default is for non-rotating objects in which case geometry calculations will interpolate the quaternions. 3.6.4 atbCreateDynStateCBI 作用:Create a dynState structure from CBI data elements 用法:dynState = atbCreateDynStateCBI('cb', posVelTimes, cbiPos, cbiVel, quatTimes, cbiQuat, angVel) dynState = atbCreateDynStateCBI('cb', posVelTimes, cbiPos, cbiVel, quatTimes, cbiQuat) 说明:cb - valid central body name, i.e. 'earth' posVelTimes - 1xN length time array for pos and vel data cbiPos - 3xN CBI position array [x;y;z] (meters) cbiVel - 3xN CBI velocity array [vx;vy;vz] (m/sec) quatTimes - 1xM time array for attitude data cbiQuat - 4xM attitude quaternion array representing the rotation from the CBI frame to the objects body axes frame angVel - optional 3xM angular velocity array representing the rotation rate around each body frame axis [rx;ry;rz] (rad/sec). The default is for non-rotating objects in which case geometry calculations will interpolate the quaternions. 3.6.5 atbLhQuatCen 作用:Compute a local horizontal coordinate frame, geocentric version 用法:quats = atbLhQuatCen(cbPos) quats = atbLhQuatCen(cbPos, cbVel) 说明:cbPos - 3xN array of position vectors [x;y;z] (meters) cbVel - optional 3xN velocity array [vx.vy;vz] (m/s). Specification of this parameter will generate a coordinate system with the X axis aligned with the velocity vector. The default is to generate a body frame with its X axis parallel to the central body equator and its Y axis pointing to the central body north pole. quats - rotation matrix from CB coordinates into a body frame with its XY plane perpendicular to the CB position vector. 3.6.6 atbLhQuatCBFDet 作用:Compute a local horizontal coordinate frame, geodetic version 用法:quats = atbLhQuatCBFDet('cbName', cbfPos) quats = atbLhQuatCBFDet('cbName', cbfPos, cbfVel) 说明:cbName - valid central body name, e.g. 'earth' cbfPos - 3xN array of CBF position vectors [x;y;z] (meters) cbfVel - optional 3xN CBF velocity array [vx.vy;vz] (m/s). Specification of this parameter will generate a coordinate system with the X axis aligned with the velocity vector. The default is to generate a body frame with its X axis parallel to the central body equator and its Y axis pointing to the central body north pole. quats - rotation matrix from CBF coordinates into a body frame with its XY plane tangent to the central body surface. 3.6.7 atbFlatten 作用:Flatten a multidimensional structure's field 用法:v = atbFlatten(s, 'field') [v, fs] = atbFlatten(s, 'field') 说明:s - multidimension structure of length m field - a fieldname of s with length n v - flatten'd matrix of size m x n, the rows of which represent each field of s fs - the size of each field. n = fs(1) * fs(2). useful when the field is a matrix. Every field must have the same length. 3.7 轨道要素转换(Orbit Element Set Conversions) 3.7.1 atbOrbCartToDel 作用:将直角坐标下的位置速度转换成两行(Delaunay)根数 用法:delElems = atbOrbCartToDel(pos, vel, gravParam) 说明:pos - inertial cartesian position vector, 3x1, meters vel - inertial cartesian velocity vector, 3x1, meters/sec gravParam - scalar gravitational paramter, see atbCbGravParam delElems - Delaunay orbit element set structure This structure has the following fields: H - z component of angular momentum G - angular momentum L - sqrt(mu * a) h - right ascension of ascending node (rad) g - argument of perigree (rad) l - mean anomaly (rad) 备注:This function errors when the magnitude of eccenVec > 1, where eccenVec = c1*pos - c2*vel c1 = norm(vel)^2 / gravParam - 1/norm(pos) c2 = dot(pos, vel) / gravParam 3.7.2 atbOrbCartToEqui 作用:将直角坐标下的位置速度转换成春分(equinoctial)根数 用法:equiElems = atbOrbCartToEqui(pos, vel, gravParam) 说明:pos - inertial cartesian position vector, 3x1, meters vel - inertial cartesian velocity vector, 3x1, meters/sec gravParam - scalar gravitational paramter, see atbCbGravParam equiElems - equinoctial orbit element set structure This structure has the following fields: a - semimajor axis length (meters) h - e * sin(omegaBar) (unitless) k - e * cos(omegaBar) (unitless) p - tan(i/2) * sin(raan) (unitless) q - tan(i/2) * cos(raan) (unitless) lambda - mean longitude (rad) isPosigrade - alternative is retrograde Where: e - orbit eccentricity i - orbit inclination raan - right ascension of ascending node omegaBar - argument of perigree + raan for posigrade or argument of perigree - raan for retrograde 备注:This function will generate an error if: 2.0 / norm(pos) - norm(vel)^2 / gravParam < 0 3.7.3 atbOrbCartToMod 作用:将直角坐标下的位置速度转换成修正(modified)根数 用法:modElems = atbOrbCartToMod(pos, vel, gravParam) 说明:pos - inertial cartesian position vector, 3x1, meters vel - inertial cartesian velocity vector, 3x1, meters/sec gravParam - scalar gravitational paramter, see atbCbGravParam modElems - modified orbit element set structure This structure has the following fields: rp - periapsis radius (meters) e - eccentricity (unitless) i - inclination (rad) raan - right ascension of ascending node (rad) ap - argument of periapsis (rad) ta - true anomaly (rad) 3.7.4 atbOrbCartToSphere 作用:将直角坐标下的位置速度转换成球形(spherical)根数 用法:sphereElems = atbOrbCartToSphere(pos, vel) 说明:pos - inertial cartesian position vector, 3x1, meters vel - inertial cartesian velocity vector, 3x1, meters/sec sphereElems - spherical orbit element set structure This structure has the following fields: ra - right ascension (rad) dec - declination (rad) r - radius (meters) fpa - horizontal flight path angle (rad) az - flight path aximuth (rad) v - speed (meters/sec) 3.7.5 atbOrbCartToMixedSphere 作用:将直角坐标下的位置速度转换成混合球形(mixed spherical)根数 用法:mixedElems = atbOrbCartToMixedSphere('cb', time, pos, vel) 说明:cb - central body name, e.g. 'Earth' time - coordinate time (seconds) pos - inertial cartesian position vector, 3x1, meters vel - inertial cartesian velocity vector, 3x1, meters/sec mixedElems - mixed spherical orbit element set structure This structure has the following fields: lon - longitude (rad)