OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
GeographicEphemeris.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
13 #include <otb/GalileanEphemeris.h>
14 
15 #include <otb/GMSTDateTime.h>
16 
17 #include <cmath>
18 
19 namespace ossimplugins
20 {
21 
22 
24 {
25 }
26 
28 {
29 }
30 
31 GeographicEphemeris::GeographicEphemeris(JSDDateTime date, double pos[3], double speed[3]) : Ephemeris(date, pos, speed)
32 {
33 }
34 
36 {
37 }
38 
40 {
41  ((Ephemeris)*this) = ((Ephemeris)rhs);
42  return *this;
43 }
44 
45 
47 {
48  const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ;
49  GMSTDateTime h;
51 
52  double s,c;
53  _date.AsGMSTDateTime(&h) ;
54 
55  c = cos (h.get_tms()) ;
56  s = sin (h.get_tms()) ;
57  vGal->set_date(_date);
58 
59  double pos[3];
60  double speed[3];
61 
62  pos[0] = _position[0] * c - _position[1] * s ;
63  pos[1] = _position[0] * s + _position[1] * c ;
64  pos[2] = _position[2] ;
65 
66  speed[0] = _speed[0] * c - _speed[1] * s - OMEGATERRE * (_position[0] * s + _position[1] * c) ;
67  speed[1] = _speed[0] * s + _speed[1] * c + OMEGATERRE * (_position[0] * c - _position[1] * s) ;
68  speed[2] = _speed[2] ;
69 
70  vGal->set_position(pos);
71  vGal->set_speed(speed);
72 }
73 
74 GeographicEphemeris::operator GalileanEphemeris()
75 {
77  ToGalilean(&rhs);
78  return rhs;
79 }
80 
82 {
83  rhs.ToGeographic(this);
84 }
85 }
This class represent an ephemeris in Geographic coordinates system.
This class represents a date.
Definition: GMSTDateTime.h:29
void set_position(double position[3])
Definition: Ephemeris.h:93
GeographicEphemeris & operator=(const GeographicEphemeris &rhs)
Affectation operator.
void ToGalilean(GalileanEphemeris *vGal)
This fonction converts the current ephemeris in the Galilean coordinates system.
void set_speed(double speed[3])
Definition: Ephemeris.h:100
void set_date(JSDDateTime date)
Definition: Ephemeris.h:88
Ephemeris()
Constructor.
Definition: Ephemeris.cpp:29
int AsGMSTDateTime(GMSTDateTime *GMST)
This function converts the current JSDDateTime into GMST Date.
void ToGeographic(GeographicEphemeris *vGeo)
This fonction converts the current ephemeris in the Geographic coordinates syst�m.
This class represents an ephemeris.
Definition: Ephemeris.h:28
virtual ~GeographicEphemeris()
Destructor.
void set_origine(Ori_TSM_Green origine)
Definition: GMSTDateTime.h:78
This class represents a date.
Definition: JSDDateTime.h:30
This class represents an ephemeris in Galilean coordinates system.