chickadee » aima » point-distance

point-distance p1 p2procedure

Calculate the distance between two points.

p1
The first point
p2
The second point
(define (point-distance p1 p2)
  (sqrt (+ (expt (- (point-x p1) (point-x p2)) 2)
           (expt (- (point-y p1) (point-y p2)) 2))))