Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Math.cpp File Reference

Math utility functions including converters, calculators, etc. More...

#include "../Include/Utility.h"

Go to the source code of this file.

Functions

double WrapTwoPi (double rad)
double WrapPi (double rad)
double Wrap360 (double deg)
int Wrap360 (int deg)
double Wrap180 (double deg)
float Wrap24 (float hrs)
float Wrap60 (float min)
Tag StringToTag (const char *s)
char * TagString (char *s, Tag tag)
void TagToString (char *s, Tag tag)
double WrapArcsec (double arcsec)
double FeetPerLonArcsec (double lat)
SPosition AddVector (SPosition &from, SVector &v)
SPosition SubtractVector (SPosition &from, SVector &v)
SVector SubtractPosition (SPosition &from, SPosition &to)
float NmToMi (float nm)
float MiToNm (float mi)
float FeetToNm (float feet)
float NmToFeet (float nm)
float FpsToKt (float fps)
double FeetToMetres (double ft)
double MetresToFeet (double m)
float KmToNm (float km)
float NmToKm (float nm)
float RadToDeg (float rad)
double RadToDeg (double rad)
float DegToRad (float deg)
double DegToRad (double deg)
SVector VectorSum (SVector v1, SVector v2)
SVector VectorDifference (SVector v1, SVector v2)


Detailed Description

Definition in file Math.cpp.


Function Documentation

SPosition AddVector SPosition from,
SVector v
 

Definition at line 195 of file Math.cpp.

References SPosition::alt, FEET_PER_LAT_ARCSEC, FeetPerLonArcsec(), SPosition::lat, SPosition::lon, WrapArcsec(), SVector::x, SVector::y, and SVector::z.

Referenced by SubtractVector(), and CCamera::UpdateCamera().

double DegToRad double  deg  ) 
 

Definition at line 323 of file Math.cpp.

References PI.

float DegToRad float  deg  ) 
 

Definition at line 318 of file Math.cpp.

References PI.

double FeetPerLonArcsec double  lat  ) 
 

Definition at line 178 of file Math.cpp.

References DegToRad(), and MEAN_CIRCUMFERENCE.

Referenced by AddVector(), and SubtractPosition().

double FeetToMetres double  ft  ) 
 

Definition at line 284 of file Math.cpp.

References METRES_PER_FOOT.

Referenced by GeocToGeod(), GeodToGeoc(), GreatCirclePolar(), and GreatCirclePosition().

float FeetToNm float  feet  ) 
 

Definition at line 266 of file Math.cpp.

References FEET_PER_NM.

Referenced by FpsToKt().

float FpsToKt float  fps  ) 
 

Definition at line 276 of file Math.cpp.

References FeetToNm().

float KmToNm float  km  ) 
 

Definition at line 294 of file Math.cpp.

References KM_PER_NM.

double MetresToFeet double  m  ) 
 

Definition at line 289 of file Math.cpp.

References METRES_PER_FOOT.

Referenced by CQTRFile::ExtractAbsoluteData(), CQTRFile::ExtractRelativeData(), GeocToGeod(), GeodToGeoc(), and GreatCirclePolar().

float MiToNm float  mi  ) 
 

Definition at line 261 of file Math.cpp.

References MILES_PER_NM.

float NmToFeet float  nm  ) 
 

Definition at line 271 of file Math.cpp.

References FEET_PER_NM.

Referenced by GlobeTileDistance(), PosToFlatCartesian(), and PosToFlatCartesianQgt().

float NmToKm float  nm  ) 
 

Definition at line 299 of file Math.cpp.

References KM_PER_NM.

float NmToMi float  nm  ) 
 

Definition at line 256 of file Math.cpp.

References MILES_PER_NM.

double RadToDeg double  rad  ) 
 

Definition at line 313 of file Math.cpp.

References PI.

float RadToDeg float  rad  ) 
 

Definition at line 308 of file Math.cpp.

References PI.

Tag StringToTag const char *  s  ) 
 

Definition at line 132 of file Math.cpp.

Referenced by CCockpitPanel::CCockpitPanel(), CFuiManager::CFuiManager(), CFuiTheme::CFuiTheme(), CDatabaseTemplate::Load(), msg_debug_send_cb(), CCameraCockpit::PanDown(), CCameraCockpit::PanLeft(), CCameraCockpit::PanRight(), CCameraCockpit::PanUp(), CSituation::Read(), CFuelSystem::Read(), CElectricalSystem::Read(), CLevelOfDetail::Read(), CRadioManager::Read(), ReadMessage(), ReadTag(), and snexttag().

SVector SubtractPosition SPosition from,
SPosition to
 

Definition at line 233 of file Math.cpp.

References SPosition::alt, FEET_PER_LAT_ARCSEC, FeetPerLonArcsec(), SPosition::lat, SPosition::lon, WrapArcsec(), SVector::x, SVector::y, and SVector::z.

SPosition SubtractVector SPosition from,
SVector v
 

Definition at line 220 of file Math.cpp.

References AddVector(), SVector::x, SVector::y, and SVector::z.

char* TagString char *  s,
Tag  tag
 

Definition at line 143 of file Math.cpp.

References TagToString().

Referenced by CFuiComponent::Read(), CFuiWindow::Read(), and CFuiGroupBox::Read().

void TagToString char *  s,
Tag  tag
 

Definition at line 149 of file Math.cpp.

Referenced by AircraftTeleportNotify(), CAnnouncement::CAnnouncement(), CGenericIndicator::CGenericIndicator(), CGenericMonitor::CGenericMonitor(), CStaticSourceSwitch::CStaticSourceSwitch(), CFuiWindowTitle::Fill(), CFuiCloseButton::Fill(), CFuiMinimizeButton::Fill(), CFuiZoomButton::Fill(), OptionsCockpitNotify(), OptionsKeysButtonsNotify(), OptionsRealismNotify(), OptionsSceneryNotify(), OptionsSetupAxesNotify(), OptionsStartupNotify(), OptionsTestControlsNotify(), CKeyMap::Print(), CCameraManager::Print(), CFuiTheme::Print(), CGaugeNeedle::Read(), CGaugeRectangle::Read(), CGaugeClickArea::Read(), CGaugeKnob::Read(), CGaugeAnnunciator::Read(), CGauge::Read(), CBitmapGauge::Read(), CNeedleGauge::Read(), CTwoNeedleGauge::Read(), CThreeNeedleGauge::Read(), CDigitalNeedleGauge::Read(), CAltimeterGauge::Read(), CRollingAltimeterGauge::Read(), CHorizonGauge::Read(), CFDHorizonGauge::Read(), CHorizontalBallGauge::Read(), CAirspeedGauge::Read(), CVerticalSpeedGauge::Read(), CDirectionalGyroGauge::Read(), CVacuumGauge::Read(), CSuctionGauge::Read(), CFuelGauge::Read(), CFuelFlowGauge::Read(), COilPressureGauge::Read(), COilTemperatureGauge::Read(), CTachometerGauge::Read(), CDualTachometerGauge::Read(), CN1TachometerGauge::Read(), CExhaustGasTemperatureGauge::Read(), CBasicCompassGauge::Read(), CAnalogClockGauge::Read(), CAmmeterGauge::Read(), CFlyhawkDigitalClockGauge::Read(), CBasicDigitalClockGauge::Read(), CBasicADFGauge::Read(), CDigitalReadoutGauge::Read(), CDigitsReadoutGauge::Read(), CCabinPressureRateKnobGauge::Read(), CCabinPressureGauge::Read(), CBrakePressureGauge::Read(), CAOANeedleGauge::Read(), CTurnCoordinatorGauge::Read(), CHSIGauge::Read(), CFlyhawkELTGauge::Read(), CSlipIndicatorGauge::Read(), CHobbsMeterGauge::Read(), CNavigationGauge::Read(), CBKNavComKX155Gauge::Read(), CBKXPDRKT76Gauge::Read(), CBKADFKR87Gauge::Read(), CBKGPSKLN89Gauge::Read(), CBKAP140Gauge::Read(), CBKKFC200Gauge::Read(), CBKKFC150Gauge::Read(), CBKAudioKMA26Gauge::Read(), CGenericNavRadioGauge::Read(), CGenericCommRadioGauge::Read(), CGenericTransponderGauge::Read(), CGenericADFRadioGauge::Read(), CRMINeedleGauge::Read(), CNavGaugeGroup::Read(), CRadioGaugeGroup::Read(), CAnnunciator::Read(), CFlyhawkAnnunciator::Read(), CFlyhawkAnnunciatorTest::Read(), CFlyhawkNavGpsPanelGauge::Read(), CFlyhawkFuelSelectorGauge::Read(), CFlyhawkElevatorTrimGauge::Read(), CMalybooCHTIndicatorGauge::Read(), CMalybooCHTButtonGauge::Read(), CMalybooNavGpsPanelGauge::Read(), CMalybooDigitalClockGauge::Read(), CMalybooEngineMonitorGauge::Read(), CNavajoFuelSelectorGauge::Read(), CNavajoAmmeterGauge::Read(), CNavajoRadarAltimeterGauge::Read(), CCollinsEFISSelectionGauge::Read(), CCollinsVspeedPanel::Read(), CCollinsHFRadioGauge::Read(), CCollinsPFDGauge::Read(), CCollinsNDGauge::Read(), CCollinsRTUGauge::Read(), CCollinsAirDataGauge::Read(), CCollinsMNDGauge::Read(), CUniversalFMSGauge::Read(), CPilatusEFISPanel::Read(), CWalkerTempAirspeedGauge::Read(), CGyroSlavingGauge::Read(), CVerticalRateGauge::Read(), CPropSyncGauge::Read(), CDMEGauge::Read(), CDME2Gauge::Read(), CWeatherRadarGauge::Read(), CAnalogAltPreselectGauge::Read(), CMomentaryHotSpotGauge::Read(), CLitInOutSwitch::Read(), CSimpleSwitch::Read(), CSimpleInOutStateSwitch::Read(), CBasicBatterySwitch::Read(), CTwoStateELTGauge::Read(), CSwitchPairGauge::Read(), CSimpleFloatSwitch::Read(), CDualSwitch::Read(), CPushPullKnobGauge::Read(), CPrimerKnobGauge::Read(), CFlapsSwitchGauge::Read(), CLitLandingGearKnobGauge::Read(), CMixtureKnobGauge::Read(), CReversibleThrottleKnobGauge::Read(), CDualKnobGauge::Read(), CFlyhawkLightKnobGauge::Read(), CTurnKnobGauge::Read(), CCoveredSwitch::Read(), CCoveredLightButtonGauge::Read(), CVerticalSliderGauge::Read(), CTrimWheelGauge::Read(), CTrimWheelIndicatorGauge::Read(), CIndicatorGauge::Read(), CFlapsIndicatorGauge::Read(), CPushButtonGauge::Read(), CLightButtonGauge::Read(), CTurnSwitchGauge::Read(), CMasterCautionWarningButtonGauge::Read(), CKAFireExtinguisherButton::Read(), CWalkerAPPanel::Read(), CWalkerFirePanel::Read(), CLightSwitchSetGauge::Read(), CRockerSwitch::Read(), CAirplane::Read(), CDataMapPolynomial::Read(), CDataMapTable::Read(), CDataMap::Read(), CCockpitPanel::Read(), CCameraCockpit::Read(), CCursor::Read(), CHelicopter::Read(), CKeyDefinition::Read(), CKeySet::Read(), CKeyMap::Read(), CPanel::Read(), CSituation::Read(), CSubsystem::Read(), CGenericMonitor::Read(), CGenericIndicator::Read(), CPneumaticPump::Read(), CEmergencyLocator::Read(), CExteriorLight::Read(), CPitotStaticSwitch::Read(), CAnnunciatorLight::Read(), CStallWarning::Read(), CLightSettingState::Read(), CSwitchSet::Read(), CBattery::Read(), CAlternator::Read(), CPitotStaticSubsystem::Read(), CAltimeter::Read(), CVerticalSpeedIndicator::Read(), CAirspeedIndicator::Read(), CPneumaticSubsystem::Read(), CAttitudeIndicator::Read(), CDirectionalGyro::Read(), CVacuumIndicator::Read(), CTurnCoordinator::Read(), CBKKAP140Panel::Read(), CAmmeter::Read(), CEngineSubsystem::Read(), COilPressure::Read(), CBaseControl::Read(), CMixtureControl::Read(), CFlapControl::Read(), CRadio::Read(), CNavRadio::Read(), CADFRadio::Read(), CTransponderRadio::Read(), CBKKT76Radio::Read(), CBKKLN89GPSRadio::Read(), CFuelSubsystem::Read(), CFuelTap::Read(), CFuelCell::Read(), CFuelHeater::Read(), CFuelMath::Read(), CFuelPump::Read(), CFuelSource::Read(), CFuelTank::Read(), CEngineFuelPump::Read(), CFuelManagement::Read(), CAPUFuelSource::Read(), CPitotStaticPort::Read(), CSimulatedVehicle::Read(), CFuelSystem::Read(), CAerodynamicModel::Read(), CElectricalSystem::Read(), CPitotStaticSystem::Read(), CGroundSuspension::Read(), CLoadoutUnit::Read(), CVariableLoadouts::Read(), CCockpitManager::Read(), CCameraManager::Read(), CLevelOfDetail::Read(), CRadioManager::Read(), CExternalLights::Read(), CEngineManager::Read(), CControlMixer::Read(), CChecklists::Read(), CFlightControlSystem::Read(), CSlopeWindData::Read(), CWorldObject::Read(), CFuiWindow::ReadFinished(), CFuiButton::ReadFinished(), CFuiPopupMenu::ReadFinished(), CFuiCheckbox::ReadFinished(), CFuiRadioButton::ReadFinished(), CFuiLabel::ReadFinished(), CFuiTextField::ReadFinished(), CFuiList::ReadFinished(), ReadMessage(), SendMessage(), TagString(), and CSubsystem::TypeIs().

SVector VectorDifference SVector  v1,
SVector  v2
 

Definition at line 345 of file Math.cpp.

References SVector::x, SVector::y, and SVector::z.

SVector VectorSum SVector  v1,
SVector  v2
 

Definition at line 332 of file Math.cpp.

References SVector::x, SVector::y, and SVector::z.

double Wrap180 double  deg  ) 
 

Definition at line 89 of file Math.cpp.

References Wrap360().

Referenced by CTimeManager::GetLocalSiderealTime(), and CNavRadio::TimeSlice().

float Wrap24 float  hrs  ) 
 

Definition at line 106 of file Math.cpp.

Referenced by CTimeManager::GetGreenwichSiderealTime(), CTimeManager::GetLocalSiderealTime(), and CTimeManager::SunriseSunset().

int Wrap360 int  deg  ) 
 

Definition at line 75 of file Math.cpp.

double Wrap360 double  deg  ) 
 

Definition at line 61 of file Math.cpp.

float Wrap60 float  min  ) 
 

Definition at line 120 of file Math.cpp.

double WrapArcsec double  arcsec  ) 
 

Definition at line 159 of file Math.cpp.

Referenced by AddVector(), and SubtractPosition().

double WrapPi double  rad  ) 
 

Definition at line 47 of file Math.cpp.

double WrapTwoPi double  rad  ) 
 

Definition at line 33 of file Math.cpp.

Referenced by calc_zenith_azimuth_angles(), CModelACM::CModelACM(), FormatRADec(), CStarImages::LoadBSCDatabase(), CStarImages::LoadFlyDatabase(), CCameraSpot::PanLeft(), CCameraObserver::PanLeft(), CCameraSpot::PanRight(), CCameraObserver::PanRight(), CCamera::UpdateCamera(), CCelestialBody::UpdateOrbElements(), and CMoon::UpdatePosition().

SourceForge.net Logo Documentation generated by doxygen