skill.geometry.Point_getDistanceTo

Last-modified: 2013-03-04 (月) 23:50:40
; -----------------------------------------------------------------------------
; (Point_getDistanceTo this another)
; -----------------------------------------------------------------------------
; 二点 this と another の間の距離を求めて返す、汎用の関数。
; -----------------------------------------------------------------------------
(define (Point_getDistanceTo this another)
  (let
    (
    (dx (difference (car  this) (car  another)))
    (dy (difference (cadr this) (cadr another)))
    )
    (sqrt (plus (times dx dx) (times dy dy)))
  )
)