1. ## Arguments

Registered forum members do not see this ad.

Hello to all,

Attached below are three formulas to solve for distance for ellipsodial heads of different types.
My question is can each formula be written in one argument or does it need to be written in several?
I am not completely sure how to break this down. Any help on this would be greatly appreciated.

The Buzzard

2. Sorry,

I think I explained myself incorrectly.
What I meant was can each formula be written in one statement with the given arguments.

3. Originally Posted by The Buzzard
Sorry,

I think I explained myself incorrectly.
What I meant was can each formula be written in one statement with the given arguments.
Not sure about but have you tried use the COND statement?

~'J'~

4. I probably overlooked something, but this should be a good example (your first function)...

Code:
```(defun foo (L r O D tt / _sq)
(setq _sq (lambda (#) (* # #)))

(- L (sqrt (- (_sq (- L r)) (_sq (/ (* O D) (apply '- (list 2 tt r)))))))
) ;_ defun```

5. Sorry again,

Fixo,

I do not mean to combine all three or a way to pick a formula.
For each formula above can the supplied arguments be put into one continuous statement for each formula.

6. Thanks Alan,

I think I can figure the rest from here.
But what is apply in the statement for.

7. Originally Posted by The Buzzard
Thanks Alan,

I think I can figure the rest from here.
But what is apply in the statement for.
It was to subtract the 3 numbers, but I completely forgot you can add more than 2 numbers to the (- function.

Code:
```(defun foo (L r O D tt / _sq)
(setq _sq (lambda (#) (* # #)))

(- L (sqrt (- (_sq (- L r)) (_sq (/ (* O D) (- 2 tt r))))))
) ;_ defun```

8. You don't have to use the _sq sub function. However, it saves you a lot of typing and condenses your routine quite a bit.

Code:
`(setq _sq (lambda (#) (* # #)))`

9. Alan,

I looked up apply Function,

Passes a list of arguments to, and executes, a specified function.

Thanks

10. Registered forum members do not see this ad.

Originally Posted by The Buzzard
Alan,

I looked up apply Function,

Passes a list of arguments to, and executes, a specified function.

Thanks
Hope it helps.
And good luck keeping your head on straight while typing everything out.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts