math.physics.pos: distance method

db4
Eduardo Cavazos 2008-07-12 12:22:27 -05:00
parent 4812c95db6
commit c1328ac08e
1 changed files with 12 additions and 0 deletions

View File

@ -1,5 +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 ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!