Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute LISP Online

(defun distance(p1 p2)

    (setf x1 (car(p1)))
    (setf x2 (car(p2)))
    (setf y1 (cdr(p1)))
    (setf y2 (cdr(p2)))
    (sqrt (+  (* (- x1 x2) (- x1 x2))  (* (- y1 y2) (- y1 y2)) ) )


)

(funcall 'distance (3 3) (2 2)))

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.