]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/bezier.hh
release: 1.3.13
[lilypond.git] / lily / include / bezier.hh
1 /*
2   bezier.hh -- declare Bezier and Bezier_bow
3
4   (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
5 */
6
7 #ifndef BEZIER_HH
8 #define BEZIER_HH
9
10
11 #include "real.hh"
12 #include "drul-array.hh"
13 #include "interval.hh"
14 #include "axes.hh"
15 #include "offset.hh"
16 #include "array.hh"
17 #include "polynomial.hh"
18
19 /**
20   Simple bezier curve
21  */
22 class Bezier
23 {
24 public:
25   Bezier ();
26
27   void rotate (Real);
28   void translate (Offset);
29   void flip (Axis);
30   void check_sanity () const;
31   Real get_other_coordinate (Axis a, Real x) const;
32   Array<Real> solve_point (Axis, Real coordinate) const;
33   Array<Real> solve_derivative (Offset) const;
34   Interval extent (Axis)const;
35   Polynomial polynomial (Axis)const;
36   Offset curve_point (Real t) const;
37
38   static const int CONTROL_COUNT = 4;
39   Offset control_[CONTROL_COUNT];
40 };
41
42
43 #endif // BEZIER_HH
44