Skip to content

Commit fa92ec6

Browse files
Merge pull request geekcomputers#1322 from RohitSgh/patch-1
Create Shortest Distance between Two Lines.py
2 parents 85fd9cc + 392fd56 commit fa92ec6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import math
2+
import numpy as NP
3+
4+
LC1=eval(input("Enter DRs of Line 1 : "))
5+
LP1=eval(input("Enter Coordinate through which Line 1 passes : "))
6+
LC2=eval(input("Enter DRs of Line 2 : "))
7+
LP2=eval(input("Enter Coordinate through which Line 2 passes : "))
8+
a1,b1,c1,a2,b2,c2=LC1[0],LC1[1],LC1[2],LC2[0],LC2[1],LC2[2]
9+
x=NP.array([[LP2[0]-LP1[0],LP2[1]-LP1[1],LP2[2]-LP1[2]],[a1,b1,c1],[a2,b2,c2]])
10+
y=math.sqrt((((b1*c2)-(b2*c1))**2)+(((c1*a2)-(c2*a1))**2)+(((a1*b2)-(b1*a2))**2))

0 commit comments

Comments
 (0)