+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Forum Newbie
    Using
    not specified
    Join Date
    May 2006
    Posts
    1

    Default Distance between two lines

    Registered forum members do not see this ad.

    Can abybody help me with this lisp ? I need distance between two lines.
    Thank you in advance

  2. #2
    Forum Deity
    Using
    not specified
    Join Date
    Jul 2004
    Location
    Anchorage, Alaska
    Posts
    2,074

    Default

    The distance between 2 lines varies, unless they are parallel and in the same plane. In algebra a "line" has an infinite length, a line segment is finite. Can you re-state the problem, being more specific?

  3. #3
    Senior Member
    Using
    AutoCAD 2005
    Join Date
    Dec 2005
    Location
    Brandon, Manitoba, Canada
    Posts
    166

    Default

    You can find the distance between two points by
    ((X1-X2)^2+(Y1-Y2)^2+(Z1-Z2)^2)^0.5=Distance
    this is the Pythagorean theorem
    Thalon

  4. #4
    Senior Member kpblc's Avatar
    Using
    AutoCAD 2005
    Join Date
    May 2006
    Location
    Russia, St-Petersburg
    Posts
    361

    Default

    Code:
    (defun c:dd (/ pt1 pt2 res)
      (if (and (setq pt1 (getpoint "\nSelect the point1 <exit> : "))
           (setq pt2 (getpoint pt1 "\bSelect the point2 <exit> : "))
           ) ;_ end of and
        (setq res (distance pt1 pt2))
        ) ;_ end of if
      res
      ) ;_ end of defun
    You can also use command
    Code:
    dist
    and analyze the log of it works...
    All I say is only my opinion.

  5. #5
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Apr 2006
    Location
    Los Angeles
    Posts
    65

    Default

    Registered forum members do not see this ad.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts