0 Members and 1 Guest are viewing this topic.
It's not perpendicular
Firstly, note that you would need to supply the function with the vectors (-1.1 5.6) & (5.6 1.2), since you are looking for the vectors emanating from the point (8.4 -2.3):Code - Auto/Visual Lisp: [Select]_$ (mapcar '- '(7.3 3.3) '(8.4 -2.3))(-1.1 5.6)_$ (mapcar '- '(14.0 -1.1) '(8.4 -2.3))(5.6 1.2)However, these vectors are still not perpendicular (89.0183 degrees apart):Code - Auto/Visual Lisp: [Select]_$ (rtd (acos (/ (vxv '(-1.1 5.6) '(5.6 1.2)) (|v| '(-1.1 5.6)) (|v| '(5.6 1.2)))))89.0183
Where I can find all those math functions like vxv , v etc?
You need to take a trip/visit to Lee's site:http://www.lee-mac.com/index.htmlAnd spend some time reading all the GREAT STUFF, he have in there for many to simple use OOB or to learn (<- I recommend)... AFAIK some of those function names are Lee's... HTH
Quote from: Shay Gaghe on July 10, 2014, 02:19:35 PM Where I can find all those math functions like vxv , v etc?I think I've already given you the link in your thread over at CADTutor, but if not: Mathematical Functions
Is there any mathematical explination about those functions?
Lee . Won't the following would be equivalent at anyway ?
Quote from: Tharwat on July 10, 2014, 05:07:39 PMLee . Won't the following would be equivalent at anyway ?Yes, however the use of the angle function will mean that 3D vectors will be dependent on the UCS.
(defun entsel-pre-p (/ ent vertex vertexList u v vos) (if (setq ent (car (entsel "\nSelect an object"))) (if (setq ent (entget ent)) (progn (foreach vertex ent (if (= (car vertex) 10) (setq vertexList (cons (cdr vertex) vertexList)) ) ) (setq v (car vertexList) u (car (reverse vertexList)) ) (setq vos (apply '+ (mapcar '* u v))) (equal 0.0 vos 1e-8) ) ) ))
Regarding the piccy you posted,What is the vector for each of the arms in the left grid .. and in the right grid.? ie:What is it's Length, Delta X and Delta Y dimensions ?