]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/offset.hh
(try_music): ignore slurs_. Otherwise we
[lilypond.git] / flower / include / offset.hh
index 8c57c3de2968d1bab7c46ff4671bb6f655fab499..ccf64ea784e172007a99c10a63888461b852542d 100644 (file)
@@ -18,10 +18,12 @@ Offset complex_divide (Offset, Offset);
 Offset complex_exp (Offset);
 
 
-/** 2d vector
-    should change to Complex -- how is vector == complex?
+/*
+
+This is a mixture a 2D vector. Sometimes it can
+also be convenient to think of 2D vectors as complex numbers
+(ie. x + i y). The naming of some methods reflects that.
 
-    ughr wat een beerput
 */
 class Offset 
 {
@@ -100,10 +102,9 @@ public:
   Real arg () const;
   Real length () const;
 
-  //wtf, How is Offset a Complex? is this used?
   Offset operator *= (Offset z2) 
   {
-    *this = complex_multiply (*this,z2);
+    *this = complex_multiply (*this, z2);
     return *this;
   }
 
@@ -134,6 +135,13 @@ mirror (Offset o, Axis a)
   return o;
 }
 
+inline
+Real
+dot_product  (Offset o1, Offset o2)
+{
+  return o1[X_AXIS] * o2[X_AXIS] + o1[Y_AXIS] * o2[Y_AXIS];
+}
+
 
 #endif /* OFFSET_HH */