我有两条线在一点交叉.我知道这两行的终点.如何计算Python中的交叉点?
# Given these endpoints
#line 1
A = [X, Y]
B = [X, Y]
#line 2
C = [X, Y]
D = [X, Y]
# Compute this:
point_of_intersection = [X, Y]
Run Code Online (Sandbox Code Playgroud) 设0 <= x <= 1.我有两列f和g,长度分别为5000.现在我的情节:
plt.plot(x, f, '-')
plt.plot(x, g, '*')
Run Code Online (Sandbox Code Playgroud)
我想找到曲线相交的点'x'.我不想找到f和g的交集.我可以简单地用以下方法做到:
set(f) & set(g)
Run Code Online (Sandbox Code Playgroud)