\hypertarget{ATT_8h}{
\section{ATT.h File Reference}
\label{ATT_8h}\index{ATT.h@{ATT.h}}
}
LAT Attitude Processing Package. 

{\tt \#include \char`\"{}ATT/ATT\_\-msg.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/WCT.h\char`\"{}}\par


Include dependency graph for ATT.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=114pt]{ATT_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=106pt]{ATT_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Attitude Processing Control Functions}
\begin{CompactItemize}
\item 
\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ \hyperlink{ATT_8h_a1}{ATT\_\-get} (void)
\begin{CompactList}\small\item\em Get pointer to attitude processing global handle. \item\end{CompactList}\item 
unsigned int \hyperlink{ATT_8h_a2}{ATT\_\-init} (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ctl, unsigned int num\-Secs)
\begin{CompactList}\small\item\em Initialize global attitude processing handle. \item\end{CompactList}\item 
unsigned int \hyperlink{ATT_8h_a3}{ATT\_\-exit} (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ctl)
\begin{CompactList}\small\item\em Shutdown the attitude processing global handle. \item\end{CompactList}\item 
unsigned int \hyperlink{ATT_8h_a4}{ATT\_\-reset} (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ctl)
\begin{CompactList}\small\item\em Reset the attitude processing global handle. \item\end{CompactList}\item 
unsigned int \hyperlink{ATT_8h_a5}{ATT\_\-update} (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ctl, const WCT\_\-time t, const double $\ast$Q, const float $\ast$W)
\begin{CompactList}\small\item\em Update attitude history list. \item\end{CompactList}\item 
unsigned int \hyperlink{ATT_8h_a6}{ATT\_\-lookup} (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ctl, const WCT\_\-time t, double $\ast$Q)
\begin{CompactList}\small\item\em Lookup attitude information in history list. \item\end{CompactList}\item 
unsigned int \hyperlink{ATT_8h_a7}{ATT\_\-range} (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ctl, WCT\_\-time $\ast$t\-Bottom, WCT\_\-time $\ast$t\-Top)
\begin{CompactList}\small\item\em Get current time range of history list. \item\end{CompactList}\item 
unsigned int \hyperlink{ATT_8h_a8}{ATT\_\-xform} (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ctl, const WCT\_\-time t, const double $\ast$Vl, double $\ast$Vj)
\begin{CompactList}\small\item\em Trasform a vector from LAT coordinates to J2000 coordinates. \item\end{CompactList}\end{CompactItemize}
\subsection*{Vector Utility Functions}
\begin{CompactItemize}
\item 
void \hyperlink{ATT_8h_a9}{ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-rad} (const double $\ast$Vc, double $\ast$Vs)
\begin{CompactList}\small\item\em Transform a cartesian vector to spherical (ra,dec) coordinates (radians). \item\end{CompactList}\item 
void \hyperlink{ATT_8h_a10}{ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-deg} (const double $\ast$Vc, double $\ast$Vs)
\begin{CompactList}\small\item\em Transform a cartesian vector to spherical (ra,dec) coordinates (degrees). \item\end{CompactList}\item 
double \hyperlink{ATT_8h_a11}{ATT\_\-vec\_\-magnitude} (const double $\ast$V)
\begin{CompactList}\small\item\em Get a vector magnitude. \item\end{CompactList}\item 
void \hyperlink{ATT_8h_a12}{ATT\_\-vec\_\-normalize} (double $\ast$V)
\begin{CompactList}\small\item\em Normallize a vector. \item\end{CompactList}\end{CompactItemize}
\subsection*{Quaternion Utility Functions}
\begin{CompactItemize}
\item 
void \hyperlink{ATT_8h_a13}{ATT\_\-quat\_\-multiply} (double $\ast$Qr, const double $\ast$Qa, const double $\ast$Qb)
\begin{CompactList}\small\item\em Multiply two quaternions. \item\end{CompactList}\item 
double \hyperlink{ATT_8h_a14}{ATT\_\-quat\_\-magnitude} (const double $\ast$Q)
\begin{CompactList}\small\item\em Get a quaternion magnitude. \item\end{CompactList}\item 
void \hyperlink{ATT_8h_a15}{ATT\_\-quat\_\-normalize} (double $\ast$Q)
\begin{CompactList}\small\item\em Normallize a quaternion. \item\end{CompactList}\item 
void \hyperlink{ATT_8h_a16}{ATT\_\-quat\_\-conjugate} (double $\ast$Qr, const double $\ast$Qa)
\begin{CompactList}\small\item\em Get a quaternion conjugate. \item\end{CompactList}\end{CompactItemize}
\subsection*{Vector Transform Functions}
\begin{CompactItemize}
\item 
void \hyperlink{ATT_8h_a17}{ATT\_\-xform\_\-vec\_\-by\_\-quat} (double $\ast$Ve, const double $\ast$Q, const double $\ast$Vl)
\begin{CompactList}\small\item\em Tranform vector coordinates from LAT to J2000. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{struct__ATT__Control}{\_\-ATT\_\-Control} \hyperlink{ATT_8h_a0}{ATT\_\-Control}
\end{CompactItemize}


\subsection{Detailed Description}
LAT Attitude Processing Package. 

\begin{Desc}
\item[Author:]D.L. Wood\end{Desc}
This library contains functions and definitions for manipulating and transforming vectors in LAT instrument body coordinates to vectors in J2000 coordinates. The ultimate goal is to produce a vector in J2000 coordinates (RA, DEC) for any given cartesian vector in LAT local coordinates.

The attitude information is input in the form of an attidude state vector which consists of a:

\begin{enumerate}
\item Timestamp as a 64-bit WCT value\item Four element SC-J2000 attitude quaternion\item Three element SC angular velocity vector\end{enumerate}


This information is provided to the LAT from the SC GNC system. The attitude library maintains a short time history of the attitude information to allow for vector transformations at arbitrary times in the recent past. Call the function \hyperlink{ATT_8h_a5}{ATT\_\-update()} to inform the attitude processing software of a new message available from the SC.

\subsection{Typedef Documentation}
\hypertarget{ATT_8h_a0}{
\index{ATT.h@{ATT.h}!ATT_Control@{ATT\_\-Control}}
\index{ATT_Control@{ATT\_\-Control}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-Control]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__ATT__Control}{ATT\_\-Control}}}
\label{ATT_8h_a0}


The type for the global attitude processing control descriptor.

\subsection{Function Documentation}
\hypertarget{ATT_8h_a3}{
\index{ATT.h@{ATT.h}!ATT_exit@{ATT\_\-exit}}
\index{ATT_exit@{ATT\_\-exit}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-exit]{\setlength{\rightskip}{0pt plus 5cm}unsigned int ATT\_\-exit (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ {\em ctl})}}
\label{ATT_8h_a3}


Shutdown the attitude processing global handle. 

This releases any global resources allocated in the call to \hyperlink{ATT_8h_a2}{ATT\_\-init()}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctl}]A pointer to the ATT global control structure.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A ATT MSG code.\end{Desc}
\hypertarget{ATT_8h_a1}{
\index{ATT.h@{ATT.h}!ATT_get@{ATT\_\-get}}
\index{ATT_get@{ATT\_\-get}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-get]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ ATT\_\-get (void)}}
\label{ATT_8h_a1}


Get pointer to attitude processing global handle. 

This function returns a pointer which may be passed as a parameter to the other functions in this library. The function \hyperlink{ATT_8h_a2}{ATT\_\-init()} must be called for this pointer before the other library functions are available.

\begin{Desc}
\item[Returns:]A pointer to the global instance of the attitude processing control structure.\end{Desc}
\hypertarget{ATT_8h_a2}{
\index{ATT.h@{ATT.h}!ATT_init@{ATT\_\-init}}
\index{ATT_init@{ATT\_\-init}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-init]{\setlength{\rightskip}{0pt plus 5cm}unsigned int ATT\_\-init (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ {\em ctl}, unsigned int {\em num\-Secs})}}
\label{ATT_8h_a2}


Initialize global attitude processing handle. 

This function initializes the global attitude processing control state.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctl}]A pointer to the ATT global control structure. \item[{\em num\-Secs}](Obsolete) The number of seconds backwards to maintain in the attitude history list. Starting with ATT package version V1-3-0, this parameter value is is ignored. Instead, the length of the attitude history list is obtained from the ATT\_\-DB/att\_\-data CDM database.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A ATT MSG code.\end{Desc}
\hypertarget{ATT_8h_a6}{
\index{ATT.h@{ATT.h}!ATT_lookup@{ATT\_\-lookup}}
\index{ATT_lookup@{ATT\_\-lookup}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-lookup]{\setlength{\rightskip}{0pt plus 5cm}unsigned int ATT\_\-lookup (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ {\em ctl}, const WCT\_\-time {\em t}, double $\ast$ {\em Q})}}
\label{ATT_8h_a6}


Lookup attitude information in history list. 

This function looks up the information stored for time {\em t\/} in the attitude history list.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctl}]A pointer to the ATT global control structure. \item[{\em t}]The timestamp for the attitude information. \item[{\em Q}]SC-J2000 quaternion for time {\em t\/} is placed here on successful return:\par
 Q\mbox{[}0\mbox{]} = q1 (x) \par
 Q\mbox{[}1\mbox{]} = q2 (y) \par
 Q\mbox{[}2\mbox{]} = q3 (z) \par
 Q\mbox{[}3\mbox{]} = q4 (w) \par
.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An ATT MSG code.\end{Desc}
\hypertarget{ATT_8h_a16}{
\index{ATT.h@{ATT.h}!ATT_quat_conjugate@{ATT\_\-quat\_\-conjugate}}
\index{ATT_quat_conjugate@{ATT\_\-quat\_\-conjugate}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-quat\_\-conjugate]{\setlength{\rightskip}{0pt plus 5cm}void ATT\_\-quat\_\-conjugate (double $\ast$ {\em Qr}, const double $\ast$ {\em Qa})}}
\label{ATT_8h_a16}


Get a quaternion conjugate. 

Returns the conjugate of quaternion {\em Qa\/} in {\em Qr\/}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Qa}]Input quaternion. \par
 Qa\mbox{[}0\mbox{]} = q1 (x) \par
 Qa\mbox{[}1\mbox{]} = q2 (y) \par
 Qa\mbox{[}2\mbox{]} = q3 (z) \par
 Qa\mbox{[}3\mbox{]} = q4 (w) \par
 \item[{\em Qr}]Output conjugate quaternion. \par
 Qr\mbox{[}0\mbox{]} = q1 (x) \par
 Qr\mbox{[}1\mbox{]} = q2 (y) \par
 Qr\mbox{[}2\mbox{]} = q3 (z) \par
 Qr\mbox{[}3\mbox{]} = q4 (w) \par
\end{description}
\end{Desc}
\hypertarget{ATT_8h_a14}{
\index{ATT.h@{ATT.h}!ATT_quat_magnitude@{ATT\_\-quat\_\-magnitude}}
\index{ATT_quat_magnitude@{ATT\_\-quat\_\-magnitude}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-quat\_\-magnitude]{\setlength{\rightskip}{0pt plus 5cm}double ATT\_\-quat\_\-magnitude (const double $\ast$ {\em Q})}}
\label{ATT_8h_a14}


Get a quaternion magnitude. 

Returns the magnitude of quaternion {\em Q\/}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Q}]Input quaternion. \par
 Q\mbox{[}0\mbox{]} = q1 (x) \par
 Q\mbox{[}1\mbox{]} = q2 (y) \par
 Q\mbox{[}2\mbox{]} = q3 (z) \par
 Q\mbox{[}3\mbox{]} = q4 (w) \par
\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The magnitude of {\em Q\/}.\end{Desc}
\hypertarget{ATT_8h_a13}{
\index{ATT.h@{ATT.h}!ATT_quat_multiply@{ATT\_\-quat\_\-multiply}}
\index{ATT_quat_multiply@{ATT\_\-quat\_\-multiply}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-quat\_\-multiply]{\setlength{\rightskip}{0pt plus 5cm}void ATT\_\-quat\_\-multiply (double $\ast$ {\em Qr}, const double $\ast$ {\em Qa}, const double $\ast$ {\em Qb})}}
\label{ATT_8h_a13}


Multiply two quaternions. 

Multilplies the quaternion {\em Qa\/} by quaternion {\em Qb\/} and stores the result in {\em Qr\/}. Qr = Qb x Qa. This operation is not commutative.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Qa}]Input quaternion. \par
 Qa\mbox{[}0\mbox{]} = q1 (x) \par
 Qa\mbox{[}1\mbox{]} = q2 (y) \par
 Qa\mbox{[}2\mbox{]} = q3 (z) \par
 Qa\mbox{[}3\mbox{]} = q4 (w) \par
\item[{\em Qb}]Input quaternion. \par
 Qb\mbox{[}0\mbox{]} = q1 (x) \par
 Qb\mbox{[}1\mbox{]} = q2 (y) \par
 Qb\mbox{[}2\mbox{]} = q3 (z) \par
 Qb\mbox{[}3\mbox{]} = q4 (w) \par
\item[{\em Qr}]Output quaternion product. \par
 Qr\mbox{[}0\mbox{]} = q1 (x) \par
 Qr\mbox{[}1\mbox{]} = q2 (y) \par
 Qr\mbox{[}2\mbox{]} = q3 (z) \par
 Qr\mbox{[}3\mbox{]} = q4 (w) \par
\end{description}
\end{Desc}
\hypertarget{ATT_8h_a15}{
\index{ATT.h@{ATT.h}!ATT_quat_normalize@{ATT\_\-quat\_\-normalize}}
\index{ATT_quat_normalize@{ATT\_\-quat\_\-normalize}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-quat\_\-normalize]{\setlength{\rightskip}{0pt plus 5cm}void ATT\_\-quat\_\-normalize (double $\ast$ {\em Q})}}
\label{ATT_8h_a15}


Normallize a quaternion. 

Modifies quaternion {\em Q\/} so that the result has magnitude '1'. This function works in place.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Q}]Input quaternion. \par
 Q\mbox{[}0\mbox{]} = q1 (x) \par
 Q\mbox{[}1\mbox{]} = q2 (y) \par
 Q\mbox{[}2\mbox{]} = q3 (z) \par
 Q\mbox{[}3\mbox{]} = q4 (w) \par
\end{description}
\end{Desc}
\hypertarget{ATT_8h_a7}{
\index{ATT.h@{ATT.h}!ATT_range@{ATT\_\-range}}
\index{ATT_range@{ATT\_\-range}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-range]{\setlength{\rightskip}{0pt plus 5cm}unsigned int ATT\_\-range (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ {\em ctl}, WCT\_\-time $\ast$ {\em t\-Bottom}, WCT\_\-time $\ast$ {\em t\-Top})}}
\label{ATT_8h_a7}


Get current time range of history list. 

This function looks up current range of times in the attitude history list.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctl}]A pointer to the ATT global control structure. \item[{\em t\-Bottom}]Stores the bottom (earliest) time from the history list. \item[{\em t\-Top}]Stores the top (latest) time from the history list.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An ATT MSG code.\end{Desc}
\hypertarget{ATT_8h_a4}{
\index{ATT.h@{ATT.h}!ATT_reset@{ATT\_\-reset}}
\index{ATT_reset@{ATT\_\-reset}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}unsigned int ATT\_\-reset (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ {\em ctl})}}
\label{ATT_8h_a4}


Reset the attitude processing global handle. 

This clears the attitude history list current entries and resets the history list to its initial state.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctl}]A pointer to the ATT global control structure.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A ATT MSG code.\end{Desc}
\hypertarget{ATT_8h_a5}{
\index{ATT.h@{ATT.h}!ATT_update@{ATT\_\-update}}
\index{ATT_update@{ATT\_\-update}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-update]{\setlength{\rightskip}{0pt plus 5cm}unsigned int ATT\_\-update (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ {\em ctl}, const WCT\_\-time {\em t}, const double $\ast$ {\em Q}, const float $\ast$ {\em W})}}
\label{ATT_8h_a5}


Update attitude history list. 

This function updates the tail of the attitude history list.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctl}]A pointer to the ATT global control structure. \item[{\em t}]The timestamp for the attitude information. \item[{\em Q}]SC-J2000 quaternion for time {\em t\/}. \par
 Q\mbox{[}0\mbox{]} = q1 (x) \par
 Q\mbox{[}1\mbox{]} = q2 (y) \par
 Q\mbox{[}2\mbox{]} = q3 (z) \par
 Q\mbox{[}3\mbox{]} = q4 (w) \par
. \item[{\em W}]The SC angular velocity vector for time {\em t\/} (units rad/sec). \par
 W\mbox{[}0\mbox{]} = wx \par
 W\mbox{[}1\mbox{]} = wy \par
 W\mbox{[}2\mbox{]} = wz \par
\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An ATT MSG code.\end{Desc}
\hypertarget{ATT_8h_a10}{
\index{ATT.h@{ATT.h}!ATT_vec_cart_to_sphr_deg@{ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-deg}}
\index{ATT_vec_cart_to_sphr_deg@{ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-deg}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-deg]{\setlength{\rightskip}{0pt plus 5cm}void ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-deg (const double $\ast$ {\em Vc}, double $\ast$ {\em Vs})}}
\label{ATT_8h_a10}


Transform a cartesian vector to spherical (ra,dec) coordinates (degrees). 

Transforms the vector {\em Vc\/} in (x,y,z) cartesian coordinates into the vector {\em Vs\/} in (ra,dec) spherical coordinates. {\em Vs\/} is returned in degrees.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Vc}]The input vector in cartisian coordinates. \par
 Vc\mbox{[}0\mbox{]} = x \par
 Vc\mbox{[}1\mbox{]} = y \par
 Vc\mbox{[}2\mbox{]} = z \par
\item[{\em Vs}]The output vector in spherical coordinates. \par
 Vs\mbox{[}0\mbox{]} = ra \par
 Vs\mbox{[}1\mbox{]} = dec \par
\end{description}
\end{Desc}
\hypertarget{ATT_8h_a9}{
\index{ATT.h@{ATT.h}!ATT_vec_cart_to_sphr_rad@{ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-rad}}
\index{ATT_vec_cart_to_sphr_rad@{ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-rad}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-rad]{\setlength{\rightskip}{0pt plus 5cm}void ATT\_\-vec\_\-cart\_\-to\_\-sphr\_\-rad (const double $\ast$ {\em Vc}, double $\ast$ {\em Vs})}}
\label{ATT_8h_a9}


Transform a cartesian vector to spherical (ra,dec) coordinates (radians). 

Transforms the vector {\em Vc\/} in (x,y,z) cartesian coordinates into the vector {\em Vs\/} in (ra,dec) spherical coordinates. {\em Vs\/} is returned in radians.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Vc}]The input vector in cartisian coordinates. \par
 Vc\mbox{[}0\mbox{]} = x \par
 Vc\mbox{[}1\mbox{]} = y \par
 Vc\mbox{[}2\mbox{]} = z \par
\item[{\em Vs}]The output vector in spherical coordinates. \par
 Vs\mbox{[}0\mbox{]} = ra \par
 Vs\mbox{[}1\mbox{]} = dec \par
\end{description}
\end{Desc}
\hypertarget{ATT_8h_a11}{
\index{ATT.h@{ATT.h}!ATT_vec_magnitude@{ATT\_\-vec\_\-magnitude}}
\index{ATT_vec_magnitude@{ATT\_\-vec\_\-magnitude}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-vec\_\-magnitude]{\setlength{\rightskip}{0pt plus 5cm}double ATT\_\-vec\_\-magnitude (const double $\ast$ {\em V})}}
\label{ATT_8h_a11}


Get a vector magnitude. 

Returns the magnitude of vector {\em V\/}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em V}]Input vector. \par
 V\mbox{[}0\mbox{]} = x \par
 V\mbox{[}1\mbox{]} = y \par
 V\mbox{[}2\mbox{]} = z \par
\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The magnitude of {\em V\/}.\end{Desc}
\hypertarget{ATT_8h_a12}{
\index{ATT.h@{ATT.h}!ATT_vec_normalize@{ATT\_\-vec\_\-normalize}}
\index{ATT_vec_normalize@{ATT\_\-vec\_\-normalize}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-vec\_\-normalize]{\setlength{\rightskip}{0pt plus 5cm}void ATT\_\-vec\_\-normalize (double $\ast$ {\em V})}}
\label{ATT_8h_a12}


Normallize a vector. 

Modifies vector {\em V\/} so that the result has magnitude '1'. This function works in place.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em V}]Input vector. \par
 V\mbox{[}0\mbox{]} = x \par
 V\mbox{[}1\mbox{]} = y \par
 V\mbox{[}2\mbox{]} = z \par
\end{description}
\end{Desc}
\hypertarget{ATT_8h_a8}{
\index{ATT.h@{ATT.h}!ATT_xform@{ATT\_\-xform}}
\index{ATT_xform@{ATT\_\-xform}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-xform]{\setlength{\rightskip}{0pt plus 5cm}unsigned int ATT\_\-xform (\hyperlink{struct__ATT__Control}{ATT\_\-Control} $\ast$ {\em ctl}, const WCT\_\-time {\em t}, const double $\ast$ {\em Vl}, double $\ast$ {\em Vj})}}
\label{ATT_8h_a8}


Trasform a vector from LAT coordinates to J2000 coordinates. 

This function transforms a vector {\em Vl\/} input in LAT instrument coordiates into a vector {\em Vj\/} in J200 coordinates. The timestamp {\em t\/} is used to lookup the attitude information in the global history list. The SC-J2000 quaternion returned by the lookup is then applied to {\em Vl\/} to produce {\em Vj\/}. The timestamp should correspond to the time at which the transform for {\em Vl\/} should be performed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctl}]A pointer to the ATT global control structure. \item[{\em t}]The timestamp for the attitude information. \item[{\em Vl}]Input vector in LAT coordinates. \par
 Vl\mbox{[}0\mbox{]} = x \par
 Vl\mbox{[}1\mbox{]} = y \par
 Vl\mbox{[}2\mbox{]} = z \par
\item[{\em Vj}]Output vector in J2000 coordinates. \par
 Vj\mbox{[}0\mbox{]} = x \par
 Vj\mbox{[}1\mbox{]} = y \par
 Vj\mbox{[}2\mbox{]} = z \par
\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An ATT MSG code.\end{Desc}
\hypertarget{ATT_8h_a17}{
\index{ATT.h@{ATT.h}!ATT_xform_vec_by_quat@{ATT\_\-xform\_\-vec\_\-by\_\-quat}}
\index{ATT_xform_vec_by_quat@{ATT\_\-xform\_\-vec\_\-by\_\-quat}!ATT.h@{ATT.h}}
\subsubsection[ATT\_\-xform\_\-vec\_\-by\_\-quat]{\setlength{\rightskip}{0pt plus 5cm}void ATT\_\-xform\_\-vec\_\-by\_\-quat (double $\ast$ {\em Ve}, const double $\ast$ {\em Q}, const double $\ast$ {\em Vl})}}
\label{ATT_8h_a17}


Tranform vector coordinates from LAT to J2000. 

Performs coordinate transformation on the vector {\em Vl\/}, which is assumed to be a cartiesian vector in LAT instrument local coordinates (SC body coordinates). The information in quaternion {\em Q\/} is used to transform the vector coordinates into J2000 (ECI) coordinates. The resulting vector coordinates are stored in Ve.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Q}]Input quaternion. \par
 Q\mbox{[}0\mbox{]} = q1 (x) \par
 Q\mbox{[}1\mbox{]} = q2 (y) \par
 Q\mbox{[}2\mbox{]} = q3 (z) \par
 Q\mbox{[}3\mbox{]} = q4 (w) \par
\item[{\em Vl}]Input vector in LAT coordinates. \par
 Vl\mbox{[}0\mbox{]} = x \par
 Vl\mbox{[}1\mbox{]} = y \par
 Vl\mbox{[}2\mbox{]} = z \par
\item[{\em Ve}]Output vector in J2000 coordinates. \par
 Ve\mbox{[}0\mbox{]} = x \par
 Ve\mbox{[}1\mbox{]} = y \par
 Ve\mbox{[}2\mbox{]} = z \par
\end{description}
\end{Desc}
