]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/offset.hh
release: 0.0.60
[lilypond.git] / lily / include / offset.hh
1 /*
2   offset.hh -- part of LilyPond
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef OFFSET_HH
8 #define OFFSET_HH
9 #include "real.hh"
10
11 /// 2d vector 
12 struct Offset {
13     Real x,y;
14
15     Offset operator+(Offset o)const {
16         Offset r(*this);
17         r+=o;
18         return r;
19     }
20     
21     Offset operator+=(Offset o) {
22         x+=o.x;
23         y+=o.y;
24         return *this;
25     }
26     Offset(Real ix , Real iy) {
27         x=ix;
28         y=iy;
29     }
30     Offset() {
31         x=0.0;
32         y=0.0;
33     }
34 };
35
36 #endif // OFFSET_HH
37
38