]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/offset.cc
Run `make grand-replace'.
[lilypond.git] / flower / offset.cc
index 8fc956c65e6ac097ac166547ad83bf9e7cafea2b..67b97865e55ebe5f723fd2f717616257b72f9d48 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "offset.hh"
@@ -19,12 +19,6 @@ Offset::to_string () const
 }
 #endif
 
-bool
-isinf_b (Real r)
-{
-  return (fabs (r) > 1e20);
-}
-
 /*
   free bsd fix by John Galbraith
 */
@@ -33,7 +27,7 @@ Offset
 complex_multiply (Offset z1, Offset z2)
 {
   Offset z;
-  if (!isinf_b (z2[Y_AXIS]))
+  if (!isinf (z2[Y_AXIS]))
     {
       z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS] * z2[Y_AXIS];
       z[Y_AXIS] = z1[X_AXIS] * z2[Y_AXIS] + z1[Y_AXIS] * z2[X_AXIS];
@@ -105,3 +99,9 @@ Offset::direction () const
   d /= length (); 
   return d;
 }
+
+Offset
+Offset::swapped () const
+{
+  return Offset (coordinate_a_[Y_AXIS], coordinate_a_[X_AXIS]);
+}