ÄÚÈÝ·¢²¼¸üÐÂʱ¼ä : 2026/7/23 5:26:48ÐÇÆÚÒ» ÏÂÃæÊÇÎÄÕµÄÈ«²¿ÄÚÈÝÇëÈÏÕæÔĶÁ¡£
˵Ã÷£º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.