Does anybody know how to derive the x y and z angles between two points? Thanks, Devin
You'll have to be a bit more explicit. How would you define, for example, the "x angle" between two points? ___
Exactly. I was wondering if anybody had any formulas for geting the x angle between two points and, seperately, the y angle between two points and also the z angle between two points. I'm trying to define a rotation matrix. I could use trig, ie... for angle of point in the xy plane (defun xy_ang ( pt ) (atan (/ (cadr pt) (car pt))) ) But I could see divide by zero errors and such and what about the sign? How do you acout for divide by zero errors? Devin
Devin, xy angle is a lot different than the angle from the x axis. To determine the angle of a point from a single axis, you need to think in the plane that contains the point, the origin, and a point on the axis. Transforming the point to the ucs that contains those three points would give you an x,y pair that could be used with the angle function. You can do UCS transformations without having autocad actually make the UCS active by using ActiveX to add the ucs and getucsmatrix and transformby to get the points. Mathematically you could do the same things. If I were looking for that solution, I'd be searching on google or in math areas. What on earth do you use all this stuff for? Regards, Doug
I've created, with help, transformation routines to deal with transformation matrices. Rotational transformation matrices to be more precise. The exact same ones returned by active-x. Everything works great, and I'm learning alot about transformations. But I would like to create my own transformation matrix, bypassing autocad's active-x server altogether. given a plane, I need to determine the x y and z angles of that plane to create the transformation matrix. I was hoping that someone had some code I could look at to try to understand how to get the angles. I've got three points, an origin, xvector and yvector. Thanks, Devin
Hi Paul, What I mean by x angle is the rotation of a point about the x axis. For the y and z axis as well. Thanks, Devin