Offset direction () const;
Real arg () const;
+ Real angle_degrees () const;
Real length () const;
bool is_sane () const;
Offset operator *= (Offset z2);
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
*/
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... */
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);
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 ();