Cliff,
FYI, I ran some light timer tests, and found that Jadranko's was fastest by
11%, over Tony's, with yours next at 13% slower than Tony's, and a
(vl-catch-all-apply) variation bringing up a *very* distant last.
--
R. Robert Bell, MCSE
Xtending the Power
www.acadx.com
"Cliff Middleton" wrote in message
news:47769F75527D27E7BD40F621D5C688F8@in.WebX.SaUCah8kaAW...
| I should point out the obvious lack of knowlege behind this statement.
Not
| only should the (angle) function be excluded but it must be excluded since
| it projects the angle between 3D points onto the current construction
plane.
| This is why (polar p1 (angle p1 p2) d) while fine for 2D points, does not
| return the correct coord for 3D points.
|
| What I should have asked for was to exclude the (distance) function. I
find
| that it helps to retard the atrophy of brain cells to "manually" do the
math
| that we normally rely on functions to do for us plus I learn things (like
| the caveat of the angle function with 3D points).
|
| So I offer the following for comments, processing speed analysis,
| whatever...
|
| (defun point-on-line (p1 p2 d1 / d2 sc)
| (setq
| d2 (sqrt (apply '+ (mapcar '(lambda (a b) (expt (- a b) 2.0)) p1 p2)))
| sc (/ d1 d2)
| )
| (mapcar '(lambda (a b) (+ a (* sc (- b a)))) p1 p2)
| )
|
| Credit to my son for the formula to calculate the distance between two
| points [there may be other and better ways to lispify it] and the
| (mapcar...) is from Mr. Stjepanovics contribution.
|
| Thank you for the clinic and happy trails, all.
|
| Cliffo
|
| Cliff Middleton wrote in message
| news:262A663F02360D27C76A0A5BC0F12EEA@in.WebX.SaUCah8kaAW...
| | I suppose we should exclude the (angle) function from the challenge as
| well.
| |
| | Cliff Middleton wrote in message
| | news:CC9E64BF786FB517CB8A226714A62D90@in.WebX.SaUCah8kaAW...
| | | So without using the (polar) function, what is the formula for Eric's
| | | objective? (he said as his gauntlet cascaded to the floor...)
| | |
| | | Cliff
| | |
| | | R. Robert Bell wrote in message
| | | news:1D358B650846B6463EEED3017A46CF93@in.WebX.SaUCah8kaAW...
| | | | Don't feel bad Eric, it's not really *math* in this case (reduced to
| | | | giggling on the floor...)
| | | |
| | | | --
| | | | R. Robert Bell, MCSE
| | | | Xtending the Power
| | | | www.acadx.com
| | | |
| | | | "Frank Oquendo" wrote in message
| | | | news:17C804620D8B5BFA92D3993CF9AC8371@in.WebX.SaUCah8kaAW...
| | | | | (polar p1 (angle p1 p2) d)
| | | | |
| | | | | --
| | | | | Attitudes are contagious. Is yours worth catching?
| | | | | http://www.acadx.com
| | | | |
| | | | | "Eric Schneider" wrote in message
| | | | | news:CEE5E0063099941F31A459F2A130DFD6@in.WebX.SaUCah8kaAW...
| | | | | > Hello group,
| | | | | >
| | | | | > Using LISP, how would one calc a point (p3), between two other
| | points
| | | | (p1
| | | | | > and p2), a given distance (dist) from p1?
| | | | | > Example:
| | | | | >
| | | | | > p1 = (2.0 2.5 0.0)
| | | | | > p2 = (6.5 2.2 1.0)
| | | | | > dist = 1.5
| | | | | > p3 = ?
| | | | | >
| | | | | > I'm sure there is a simple formula, however, I failed 3rd grade
| math
| | | | five
| | | | | > times.
| | | | | > --
| | | | | > Eric S. eschneider@jensenprecast.com
| | | | | >
| | | | |
| | | |
| | |
| |
|