00001 00002 00008 /* 00009 */ 00011 00012 #include "TiltedDipoleMagneticModel.h" 00013 00014 namespace O_SESSAME { 00015 00019 Vector TiltedDipoleMagneticModel::GetMagneticField(const ssfTime& _currentTime, const Vector& _PositionVector) 00020 { 00021 m_MagFieldCoeffs.modelEpoch.Set(_currentTime.GetSeconds()); 00022 double alpha_m = m_MagFieldCoeffs.modelEpoch.GetEpochGreenwichMeanSiderealTime() 00023 + m_MagFieldCoeffs.CBAvgRotationRate * m_MagFieldCoeffs.modelEpoch.SecondsSinceEpoch() 00024 + m_MagFieldCoeffs.DipoleEastLongitude; 00025 00026 static Vector DipoleDirection(3); 00027 DipoleDirection(1) = sin(m_MagFieldCoeffs.DipoleCoelevation) * cos(alpha_m); 00028 DipoleDirection(2) = sin(m_MagFieldCoeffs.DipoleCoelevation) * sin(alpha_m); 00029 DipoleDirection(3) = cos(m_MagFieldCoeffs.DipoleCoelevation); 00030 00031 return pow(m_MagFieldCoeffs.CBRadius,3) * m_MagFieldCoeffs.H0 00032 / pow(norm2(_PositionVector),3) 00033 * (3 * (~DipoleDirection * _PositionVector) * _PositionVector - DipoleDirection); 00034 00035 } 00036 } 00037 00038 00039 // Do not change the comments below - they will be added automatically by CVS 00040 /***************************************************************************** 00041 * $Log: TiltedDipoleMagneticModel.cpp,v $ 00042 * Revision 1.2 2003/06/12 18:00:31 nilspace 00043 * Fixed references to CentralBody. 00044 * 00045 * Revision 1.1 2003/06/10 14:26:50 nilspace 00046 * Initial Submission. 00047 * 00048 * 00049 ******************************************************************************/