## Routine for Decomposition of Vectors

Discussion of other Lisp dialects (Arc, Clojure, AutoLisp, XLISP, etc.)

### Routine for Decomposition of Vectors

I only recently discovered the beauty of Lisp when I found two very useful routines for AutoCAD. The one, tlen.lsp calculates the length of segments and the other one plperp.lsp aids in drawing perpendicular lines. These gave me an idea that I could automate even more things and even have a whole program (I'm very far from such beautiful possibility) which would handle the tedious job of analyzing a particular set of vectors and ultimately torques in a construction. As a first step I'd like to ask you if you know of a routine that would decompose a vector along along given directions -- something like clicking on the vector and the two lines indicating the direction and, voila, the components are there. Thanks a lot for any attention this question may attract and hope I'm not in the wrong area of the forum, I just registered and yet don't have a clue as to what Lisp itself actually is (although I can program in Fortran, C++, VB.Net etc., not earning my living with it, though)
Lispzard

Posts: 1
Joined: Wed May 13, 2009 4:27 pm

### Re: Routine for Decomposition of Vectors

I moved this thread to the Other Dialects forum since it's about AutoLisp, not Common Lisp. Please keep topics categorized correctly. Thanks.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
findinglisp

Posts: 431
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX

### Re: Routine for Decomposition of Vectors

Decomposing a vector is easy.. Just a bunch of inproducts. Say decompose to a,b,c then coordinate in that system is
(vector (inpr x a) (inpr x b) (inpr x c)) (a,b,c must be independent, of course, and even then they might not be orthogonal.)
Jasper

Posts: 209
Joined: Fri Oct 10, 2008 8:22 am
Location: Eindhoven, The Netherlands