Question

Question 2 (10 pts) Write a Lisp program that calculates the length of a three-dimensional vector V: (x y z) based on the fol

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Using anonymous function

(write ((lambda (a b c)
(sqrt (+ (* (* a a))(* (* b b)) (* c c))))
10 10 10)
)

2. Without Anonymous function

(defun vectorLen (x y z)
(sqrt ( + (* x x) (* y y) (* z z)))
)
(write(vectorLen 10 10 10))

Add a comment
Know the answer?
Add Answer to:
Question 2 (10 pts) Write a Lisp program that calculates the length of a three-dimensional vector...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT