x-y-z angles...

Discussion in 'AutoCAD' started by Devin, Aug 6, 2003.

  1. Devin

    Devin Guest

    Does anybody know how to derive the x y and z angles between two points?

    Thanks,

    Devin
     
    Devin, Aug 6, 2003
    #1
  2. Devin

    Paul Turvill Guest

    You'll have to be a bit more explicit. How would you define, for example,
    the "x angle" between two points?
    ___
     
    Paul Turvill, Aug 6, 2003
    #2
  3. Devin

    Devin Guest

    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, Aug 6, 2003
    #3
  4. Devin

    Doug Broad Guest

    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
     
    Doug Broad, Aug 6, 2003
    #4
  5. Devin

    Paul Turvill Guest

    Like I said: what do you mean by the "x angle"???
    ___
     
    Paul Turvill, Aug 6, 2003
    #5
  6. Devin

    Devin Guest

    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
     
    Devin, Aug 6, 2003
    #6
  7. Devin

    Devin Guest

    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
     
    Devin, Aug 6, 2003
    #7
  8. Devin

    Devin Guest

    Thanks Bill.



     



    Devin
     
    Devin, Aug 6, 2003
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.