# Thread: Distance between two lines

1. ## 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.

2. 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. 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

4. 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...

5. Registered forum members do not see this ad.

#### Posting Permissions

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