]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/bezier.hh
release: 1.3.29
[lilypond.git] / lily / include / bezier.hh
1 /*
2   bezier.hh -- declare Bezier and Bezier_bow
3
4   (c) 1998--2000 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 assert_sanity () const;
28   void flip (Axis);
29   void reverse ();
30   void rotate (Real);
31   void translate (Offset);
32
33   Real get_other_coordinate (Axis a, Real x) const;
34   Array<Real> solve_point (Axis, Real coordinate) const;
35   Array<Real> solve_derivative (Offset) const;
36   Interval extent (Axis)const;
37   Polynomial polynomial (Axis)const;
38   Offset curve_point (Real t) const;
39
40   static const int CONTROL_COUNT = 4;
41   Array<Offset> control_;
42 };
43
44 void flip (Array<Offset>* arr_p, Axis a);
45 void rotate (Array<Offset>* arr_p, Real phi);
46 void translate (Array<Offset>* arr_p, Offset o);
47
48 #endif // BEZIER_HH
49