summaryrefslogtreecommitdiff
path: root/math/physics/pos/pos.factor
diff options
context:
space:
mode:
Diffstat (limited to 'math/physics/pos/pos.factor')
-rw-r--r--math/physics/pos/pos.factor17
1 files changed, 17 insertions, 0 deletions
diff --git a/math/physics/pos/pos.factor b/math/physics/pos/pos.factor
new file mode 100644
index 0000000..6915568
--- /dev/null
+++ b/math/physics/pos/pos.factor
@@ -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 ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+