(mapcar #'/
(list (apply #'+ (mapcar #'first points))
(apply #'+ (mapcar #'second points))
- (apply #'+
- (mapcar #'(lambda (x) (if (null (third x)) 0 (third x)))
- points)))
+ (apply #'+ (mapcar #'
+ (lambda (x) (0-if-null (third x)))
+ points)))
(list numpoints numpoints numpoints)))))
(defun dot-product-points (apoint bpoint)
The function returns '(cx cy cz)."
(let ((ax (first apoint))
(ay (second apoint))
- (az (if (null (third apoint))
- 0
- (third apoint)))
+ (az (0-if-null (third apoint)))
(bx (first bpoint))
(by (second bpoint))
- (bz (if (null (third bpoint))
- 0
- (third bpoint))))
+ (bz (0-if-null (third bpoint))))
(list (- (* ay bz) (* az by))
(- (* az bx) (* ax bz))
(- (* ax by) (* ay bx)))))