- Timestamp:
- 01/24/08 11:25:48 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8828 r8829 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2008/01/24 Thomas Bretz 22 23 * mpointing/MPointing.cc: 24 - added ClassImp for RaDec 25 26 * mpointing/MPointing.h: 27 - added code for classes AltAz and RaDec deriving from TVector2 28 not to be used in Mars and Cosy 29 30 20 31 21 32 2008/01/24 Daniel Hoehne -
trunk/MagicSoft/Mars/mpointing/MPointing.cc
r8725 r8829 92 92 ClassImp(AltAz); 93 93 ClassImp(ZdAz); 94 ClassImp(RaDec); 94 95 ClassImp(MPointing); 95 96 -
trunk/MagicSoft/Mars/mpointing/MPointing.h
r8807 r8829 19 19 20 20 // --------------------------------------------------- 21 // FIXME: Replace coord.h completely with this! 22 //#ifndef __MARS__ 23 //#include "coord.h" 24 //#else 25 class AltAz : public TVector2 21 22 #define XY TVector2 23 24 inline TVector2 Div(const TVector2 &v1, const TVector2 &v2) 25 { 26 return TVector2(v1.X()/v2.X(), v1.Y()/v2.Y()); 27 } 28 inline TVector2 Mul(const TVector2 &v1, const TVector2 &v2) 29 { 30 return TVector2(v1.X()*v2.X(), v1.Y()*v2.Y()); 31 } 32 33 inline TVector2 operator-(const TVector2 &v) { return TVector2(-v.X(), -v.Y()); } 34 35 class AltAz : public XY 26 36 { 27 37 public: 28 AltAz(Double_t alt, Double_t az) : TVector2(alt, az) 29 { 30 } 31 AltAz(const AltAz &aa) : TVector2(aa) { } 32 Double_t Alt() const { return fX; } 33 Double_t Az() const { return fY; } 34 ClassDef(AltAz, 1) 38 AltAz(double alt=0, double az=0) : XY(alt, az) {} 39 40 double Alt() const { return fX; } 41 double Az() const { return fY; } 42 43 void operator*=(double c) { fX*=c; fY*=c; } 44 void operator/=(double c) { fX*=c; fY*=c; } 45 46 void Alt(double d) { fX=d; } 47 void Az(double d) { fY=d; } 48 void operator*=(const XY &c) { fX*=c.X(); fY*=c.Y(); } 49 void operator/=(const XY &c) { fX/=c.X(); fY/=c.Y(); } 50 void operator-=(const AltAz &c) { fX-=c.fX; fY-=c.fY; } 51 void operator+=(const AltAz &c) { fX+=c.fX; fY+=c.fY; } 52 53 AltAz operator/(double c) const { return AltAz(fX/c, fY/c); } 54 AltAz operator*(double c) const { return AltAz(fX*c, fY*c); } 55 AltAz operator*(const XY &c) const { return AltAz(fX*c.X(), fY*c.Y()); } 56 AltAz operator/(const XY &c) const { return AltAz(fX/c.X(), fY/c.Y()); } 57 AltAz operator+(const AltAz &c) const { return AltAz(fX+c.fX, fY+c.fY); } 58 AltAz operator-(const AltAz &c) const { return AltAz(fX-c.fX, fY-c.fY); } 59 AltAz operator-() const { return AltAz(-fX, -fY); } 60 61 ClassDef(AltAz, 0) 35 62 }; 36 63 37 class ZdAz : public TVector264 class ZdAz : public XY 38 65 { 39 66 public: 40 ZdAz(Double_t zd, Double_t az) : TVector2(zd, az) 41 { 42 } 43 ZdAz(const ZdAz &aa) : TVector2(aa) { } 44 Double_t Zd() const { return fX; } 45 Double_t Az() const { return fY; } 46 ClassDef(ZdAz, 1) 67 ZdAz(double zd=0, double az=0) : XY(zd, az) {} 68 ZdAz(const ZdAz &c) : XY(c) {} 69 70 void operator*=(double c) { fX*=c; fY*=c; } 71 void operator/=(double c) { fX*=c; fY*=c; } 72 73 double Zd() const { return fX; } 74 double Az() const { return fY; } 75 76 void Zd(double d) { fX=d; } 77 void Az(double d) { fY=d; } 78 void operator*=(const XY &c) { fX*=c.X(); fY*=c.Y(); } 79 void operator/=(const XY &c) { fX/=c.X(); fY/=c.Y(); } 80 void operator-=(const ZdAz &c) { fX-=c.fX; fY-=c.fY; } 81 void operator+=(const ZdAz &c) { fX+=c.fX; fY+=c.fY; } 82 83 ZdAz operator/(double c) const { return ZdAz(fX/c, fY/c); } 84 ZdAz operator*(double c) const { return ZdAz(fX*c, fY*c); } 85 ZdAz operator*(const XY &c) const { return ZdAz(fX*c.X(), fY*c.Y()); } 86 ZdAz operator/(const XY &c) const { return ZdAz(fX/c.X(), fY/c.Y()); } 87 ZdAz operator+(const ZdAz &c) const { return ZdAz(fX+c.fX, fY+c.fY); } 88 ZdAz operator-(const ZdAz &c) const { return ZdAz(fX-c.fX, fY-c.fY); } 89 ZdAz operator-() const { return ZdAz(-fX, -fY); } 90 91 // MSlewing only?!? 92 double Ratio() const { return fX/fY; } 93 void Round() { fX=(int)(floor(fX+.5)); fY=(int)(floor(fY+.5)); } 94 95 ClassDef(ZdAz, 0) 47 96 }; 48 //#endif 97 98 class RaDec : public XY 99 { 100 public: 101 RaDec(double ra=0, double dec=0) : XY(ra, dec) {} 102 103 double Ra() const { return fX; } 104 double Dec() const { return fY; } 105 106 void operator*=(double c) { fX*=c; fY*=c; } 107 void operator/=(double c) { fX*=c; fY*=c; } 108 109 void Ra(double x) { fX = x; } 110 void Dec(double y) { fY = y; } 111 112 RaDec operator/(double c) const { return RaDec(fX/c, fY/c); } 113 RaDec operator*(double c) const { return RaDec(fX*c, fY*c); } 114 RaDec operator*(const XY &c) const { return RaDec(fX*c.X(), fY*c.Y()); } 115 RaDec operator+(const RaDec &c) const { return RaDec(fX+c.fX, fY+c.fY); } 116 RaDec operator-(const RaDec &c) const { return RaDec(fX-c.fX, fY-c.fY); } 117 RaDec operator-() const { return RaDec(-fX, -fY); } 118 119 ClassDef(RaDec, 0) 120 }; 121 49 122 // --------------------------------------------------- 50 123
Note:
See TracChangeset
for help on using the changeset viewer.