说明:vec1A - a 3x1 vector created by the user. vec1B - a 3x1 vector created by the user. vec2A - a 3x1 vector created by the user. vec3B - a 3x1 vector created by the user. rotQuat - a 4x1 vector quaternion 备注:Produces a quaternion for the transformation from coordinate system A to coordinate system B where the vector 1 is known in both coordinate systems. Vectors 2A and 3B are used (if supplied) to resolve the ambiguity about the vector 1 direction. After the alignment of vector 1 is achieved, the components of vectors 2A and 3B which are perpendicular to vector 1 are aligned. An example of this type of application would be to point a sensor boresight at a target while maintaining the minimum possible angle between the sun vector and the solar panels on the satellite. None of the vectors need to be unit vectors. 3.3.2 atbEulerToMtx 作用:Generate rotation matrix from Euler angles 用法:cosMtx = atbEulerToMtx(angles, sequence) 说明:angles - 3x1 vector of Euler angles sequence - 3 digit integer defining the order of rotation. (1-X, 2-Y, 3-Z). A common Euler angle is 313. cosMtx - 3x3 direction cosine matrix. 备注:Computes a direction cosine matrix from a set of Euler angles. The direction cosine matrix gives the relationship to transform from the reference coordinate system to the new coordinate system. 3.3.3 atbEulerToQuat 作用:Generate quaternion from Euler angles 用法:quat = atbEulerToQuat(angles, sequence) 说明:angles - 3x1 vector of Euler angles sequence - 3 digit integer defining the order of rotation. (1-X, 2-Y, 3-Z). A common Euler angle is 313. quat - 4x1 quaternion representing rotation 备注:Computes a rotation quaternion from a set of Euler angles. 3.3.4 atbMinRotQuat 作用:Minimum Rotation Quaternion 用法:quat = atbMinRotQuat(vec1, vec2) 说明:vec1, vec2 - 3x1 position vectors quat - 4x1 rotation quaternion 备注:Computes a quaternion to perform the minimum angle rotation to align vec1 along vec2. This can be useful in both active and passive applications. An example of an active application would be the generation of a maneuver quaternion to change the pointing of a satellite. An example of a passive application would be to determin the relationship between two coordinate systems when a vector is known in both systems. The quaternion would represent the system1 to system2 transformation. 3.3.5 atbMtxToEuler 作用:Matrix to Euler angles 用法:angles = atbMtxToEuler(cosMtx, sequence) 说明:cosMtx - 3x3 cosine matrix sequence - 3 digit integer defining the rotation order. (1-X, 2-Y, 3-Z). A common Euler angle is 313. angles - 3x1 vector of Euler angles 3.3.6 atbMtxToQuat 作用:Cosine matrix to quaternion conversion 用法:quat = atbMtxToQuat(cosMtx) 说明:cosMtx - 3x3 directional cosine matrix quat - 4x1 quaternion vector 3.3.7 atbMtxToYpr 作用:Cosine matrix to Yaw-Pitch-Roll 用法:yprVec = atbMtxToYpr(cosMtx, sequence) 说明:cosMtx - 3x3 direction cosine matrix sequence - 3 digit integer defining the rotation order yprVec - YPR angles, 3x1 3.3.8 atbQuatToMtx 作用:Quaternion to Matrix conversion 用法:cosMtx = atbQuatToMtx(quat) 说明:quat - 4x1 quaternion cosMtx - 3x3 directional cosine matrix 3.3.9 atbQuatXquat 作用:Quaternion multiplication 用法:quatC = atbQuatXquat(quatA, quatB) 说明:quatA,quatB - input 4x1 quaternions quatC - 4x1 quaternion product 备注:Computes the resultant quaternion due to the combination of the two input quaternions. The input quaternions may be thought of as representing two different rotations. The resulting quaternion represents the new rotation which is equivalent to performing the rotation of quaternion2 followed by the rotation of quaternion1. The order of the input quaternions is designed to resemble the way the rotations would appear on paper if you were writing out an equation. To rotate vector one through two rotations to produce vector 2, you would write V2 = Q1 Q2 V1. The resulting quaternion will have unit length. 3.3.10 atbYprToMtx 作用:Yaw Pitch Roll to Matrix 用法:cosMtx = atbYprToMtx(yprVec, sequence) 说明:yprVec - 3x1 Yaw-Pitch-Roll angles sequence - 3 digit integer defining the rotation order (1-Roll, 2-Pitch, 3-Yaw). A Yaw-Pitch-Roll sequence would be 321. cosMtx - 3x3 directional cosine matrix 备注:Builds a direction cosine matrix from yaw, pitch and roll angles. The sequence variable is used to specify the order of the rotations (1-Roll, 2-Pitch, 3-Yaw). A Yaw-Pitch-Roll sequence would be 321. 3.3.11 atbYprToQuat 作用:Yaw Pitch Roll to Quaternion 用法:quat = atbYprToQuat(yprVec, sequence) 说明:yprVec - 3x1 yaw-pitch-roll vector sequence - 3 digit integer defining the rotation order. (1-Roll, 2-Pitch, 3-Yaw). A Yaw-Pitch-Roll sequence would be 321. quat - 4x1 quaternion 备注:Builds a quaternion from yaw, pitch and roll angles. The sequence variable is used to specify the order of the rotations (1-Roll, 2-Pitch, 3-Yaw). A Yaw-Pitch-Roll sequence would be 321. 3.3.12 atbInterpQuat 作用:Interpolate Quaternion 用法:interpQuat = atbInterpQuat(startQuat, endQuat, interpParam) interpQuat = atbInterpQuat(startQuat, endQuat, interpParam, extraRot) 说明:startQuat - 4x1 quaternion endQuat - 4x1 quaternion interpParam - scalar interp factor. 0 < interpParam < 1 extraRot - extra rotations. interpQuat - 4x1 quaternion 备注:Interpolates two quaternions assuming a constant rate of rotation about a constant spin axis between the two end orientations. 3.4 中心对象操作与程序(Central Body Operations and Routines) 3.4.1 atbCbEphemeris 作用:Generate central body position/velocity in inertial coordinates 用法:[pos, vel] = atbCbEphemeris('cbName', times) 说明:cbName - valid central body name, e.g. 'Earth' times - vector of times to compute pos/vel for, length M pos,vel - 3xM matrices of inertial pos/vel data 备注:This function computes the position and velocity of the central body in the default inertial coordinate system at the specified time. The default inertial coordinate system has its origin at the solar system barycenter and axes that are aligned with the J2000 coordinate system. 3.4.2 atbCbGetTangent 作用:Tangent points on central body 用法:tanPts = atbCbGetTangent('cbName', posVec, normVec) 说明:cbName - Valid central body name, e.g. 'Earth' posVec - 3x1 vector, CBF position normVec - 3x1 vector, CBF normal direction tanPts - 3x2 matrix, CBF points of tangency 备注:Computes vectors to the two tangent points on the surface of the central body given a position vector specifying a location outside of the central body and a normal vector. The normal vector must be perpendicular to the position vector and the two output vectors will lie in the plane defined by the normal vector. All vectors are expressed in central body fixed coordinates. 3.4.3 atbCbGravParam 作用:Gravitational Parameter 用法:[gm, refDist, J2, J4] = atbCbGravParam('cbName') 说明:cbName - Valid central body name, e.g. 'Earth' gm - gravitational parameter (meters^3 / sec^2) refDistance - equatorial radius (meters) J2 - zonal harmonic parameter (unitless) J4 - zonal harmonic parameter (unitless) 3.4.4 atbCbGrazeAlt 作用:Grazing altitude 用法:[alt, minAltVec, isBetween] = atbCbGrazeAlt('cbName', vec1, vec2) [alt, minAltVec] = atbCbGrazeAlt('cbName', vec1, vec2) alt = atbCbGrazeAlt('cbName', vec1, vec2) 备注:The input vectors are given in the central body fixed coordinate system. The function returns the minimum altitude along the line of sight between the two locations. The CBF vector to the minimum altitude point is optionally computed. An indication of whether or not the minimum altitude point is between the end points--as opposed to at an end point-- is provided if the isBetween output is specified. 3.4.5 atbCbGrazeAngle 作用:Grazing angle 用法:angle = atbCbGrazeAngle('cbName', fromVec, toVec) 备注:The input vectors are given in the central body fixed coordinate system. The function returns the angle between the line of sight vector and the closest tangent to the surface of the central body which is coplanar with the two input vectors. The sign of this angle should be positive if the line of sight does not intersect the central body and negative otherwise. 3.4.6 atbCbIntersect 作用:Central body intersection 用法:[intx,intVec1, intVec2, mult1, mult2] = atbCbIntersect('cbName', posVec, dirVec) [intx,intVec1, intVec2] = atbCbIntersect('cbName', posVec, dirVec) intx = atbCbIntersect('cbName', posVec, dirVec) 说明:cbName - valid central body name, e.g. 'Earth' posVec - 3x1 CBF position vector dirVec - 3x1 CBF direction vector intx - True/False intVec* - Central body intercept points, CBF 3x1. mult* - Multiplier to scale dirVec by to yield the intersections 备注:This function returns True if the vector specified by the direction argument will intersect the central body and False otherwise. The origin of the direction vector is specified by the position vector. The optional vectors intx1 and intx2 are points of intersection with the central body. The optional outputs mult1 and mult2 represent scalars by which the direction vector is multiplied and then added to the position vector to yield the intersection points. The multipliers may be positive or negative depending on if the intersections occur in the positive or negative direction.