Changeset 1393 for trunk/MagicSoft/Cosy/base
- Timestamp:
- 07/10/02 08:27:36 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/base/coord.h
r1273 r1393 3 3 4 4 #include <math.h> // floor 5 #include <fstream.h> 5 6 6 7 /* pi/180: degrees to radians */ … … 34 35 class XY 35 36 { 37 friend ifstream& operator>>(ifstream &in, XY &xy); 38 friend ofstream& operator<<(ofstream &in, XY &xy); 39 36 40 protected: 37 41 double fX; … … 46 50 double X() const { return fX; } 47 51 double Y() const { return fY; } 52 53 void X(double x) { fX=x; } 54 void Y(double y) { fY=y; } 48 55 49 56 void operator/=(double c) { fX/=c; fY/=c; } … … 64 71 }; 65 72 73 inline ifstream& operator>>(ifstream &in, XY &xy) { in >> xy.fX; in >> xy.fY; return in; } 74 inline ofstream& operator<<(ofstream &out, XY &xy) { out << xy.fX << " " << xy.fY; return out; } 75 66 76 class AltAz : public XY 67 77 { … … 72 82 double Az() const { return fY; } 73 83 84 void operator*=(double c) { fX*=c; fY*=c; } 85 void operator/=(double c) { fX*=c; fY*=c; } 86 74 87 void Alt(double d) { fX=d; } 75 88 void Az(double d) { fY=d; } 76 89 void operator*=(const XY &c) { fX*=c.X(); fY*=c.Y(); } 77 90 void operator-=(const AltAz &c) { fX-=c.fX; fY-=c.fY; } 91 void operator+=(const AltAz &c) { fX+=c.fX; fY+=c.fY; } 78 92 79 93 AltAz operator/(double c) const { return AltAz(fX/c, fY/c); } … … 91 105 ZdAz(double zd=0, double az=0) : XY(zd, az) {} 92 106 ZdAz(const ZdAz &c) : XY(c) {} 107 108 void operator*=(double c) { fX*=c; fY*=c; } 109 void operator/=(double c) { fX*=c; fY*=c; } 93 110 94 111 double Zd() const { return fX; } … … 118 135 double Dec() const { return fY; } 119 136 137 void operator*=(double c) { fX*=c; fY*=c; } 138 void operator/=(double c) { fX*=c; fY*=c; } 139 120 140 void Ra(double x) { fX = x; } 121 141 void Dec(double y) { fY = y; }
Note:
See TracChangeset
for help on using the changeset viewer.