]> git.donarmstrong.com Git - lilypond.git/commitdiff
use _degrees to signify functions taking degree angles.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 24 Jan 2007 12:24:42 +0000 (13:24 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 24 Jan 2007 12:24:42 +0000 (13:24 +0100)
flower/include/offset.hh
flower/offset.cc
lily/grob.cc
lily/include/stencil.hh
lily/stencil.cc

index 0975e292b604ef05a58373ad9ef0de95235200e8..a3093c98ef2548f2157b328c44d510415352ee27 100644 (file)
@@ -99,6 +99,7 @@ public:
   Offset direction () const;
   
   Real arg () const;
+  Real angle_degrees () const;
   Real length () const;
   bool is_sane () const;
   Offset operator *= (Offset z2);
index d7ba41928336aed995de096f110d6c0a9793c78c..086147188253c81e5e35e8a30f219e3307e3a7ff 100644 (file)
@@ -74,6 +74,11 @@ Offset::arg () const
   return atan2 (coordinate_a_[Y_AXIS], coordinate_a_[X_AXIS]);
 }
 
+Real
+Offset::angle_degrees () const
+{
+  return arg () * 180 / M_PI;
+}
 /**
    euclidian vector length / complex modulus
 */
index bc948659f12b1a93e233c831ae55101660707862..1941d7d2f87d6ed2eebfa8039dd3585ed84b1f6d 100644 (file)
@@ -128,7 +128,7 @@ Grob::get_print_stencil () const
          Real x = scm_to_double (scm_cadr (rot));
          Real y = scm_to_double (scm_caddr (rot));
 
-         retval.rotate (angle, Offset (x, y));
+         retval.rotate_degrees (angle, Offset (x, y));
        }
 
       /* color support... see interpret_stencil_expression () for more... */
index 445e461380b61550241da5920d200926b324561e..820771ef7fe4d772ac072410b50d3bbe4f8e807e 100644 (file)
@@ -64,6 +64,7 @@ public:
   void translate (Offset);
   Stencil translated (Offset) const;
   void rotate (Real, Offset);
+  void rotate_degrees (Real, Offset);
   void align_to (Axis a, Real x);
   void translate_axis (Real, Axis);
 
index b88b0c8bdebb50581e275babe0a9fdb819e17f23..12bbf4ea128f0f573a41ae1e9b7d1f6cabd5fbe4 100644 (file)
@@ -73,11 +73,17 @@ Stencil::extent_box () const
   return dim_;
 }
 
+void
+Stencil::rotate (Real a, Offset off)
+{
+  rotate_degrees (a *180/M_PI, off); 
+}
+
 /*
* Rotate this stencil around the point [x, y]
+  Rotate this stencil around the point [x, y]
  */
 void
-Stencil::rotate (Real a, Offset off)
+Stencil::rotate_degrees (Real a, Offset off)
 {
   const Real x_cen = extent (X_AXIS).center ();
   const Real y_cen = extent (Y_AXIS).center ();