From: Han-Wen Nienhuys Date: Wed, 24 Jan 2007 12:24:42 +0000 (+0100) Subject: use _degrees to signify functions taking degree angles. X-Git-Tag: release/2.11.14-1~40 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=767d1f1909e4f02ec58c3b71a35d70e04a0c8baa;p=lilypond.git use _degrees to signify functions taking degree angles. --- diff --git a/flower/include/offset.hh b/flower/include/offset.hh index 0975e292b6..a3093c98ef 100644 --- a/flower/include/offset.hh +++ b/flower/include/offset.hh @@ -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); diff --git a/flower/offset.cc b/flower/offset.cc index d7ba419283..0861471882 100644 --- a/flower/offset.cc +++ b/flower/offset.cc @@ -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 */ diff --git a/lily/grob.cc b/lily/grob.cc index bc948659f1..1941d7d2f8 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -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... */ diff --git a/lily/include/stencil.hh b/lily/include/stencil.hh index 445e461380..820771ef7f 100644 --- a/lily/include/stencil.hh +++ b/lily/include/stencil.hh @@ -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); diff --git a/lily/stencil.cc b/lily/stencil.cc index b88b0c8bde..12bbf4ea12 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -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 ();