]> gitweb.factorcode.org Git - factor-unmaintained.git/blobdiff - math/physics/pos/pos.factor
physics: moving to math.physics to match IN: declarations.
[factor-unmaintained.git] / math / physics / pos / pos.factor
diff --git a/math/physics/pos/pos.factor b/math/physics/pos/pos.factor
new file mode 100644 (file)
index 0000000..6915568
--- /dev/null
@@ -0,0 +1,17 @@
+
+USING: kernel sequences multi-methods accessors math.vectors ;
+
+IN: math.physics.pos
+
+TUPLE: pos pos ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+GENERIC: distance ( a b -- c )
+
+METHOD: distance { sequence sequence } v- norm ;
+
+METHOD: distance { pos pos } [ pos>> ] bi@ distance ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+