두벡터의 교차점1 Qgis&Arcgis) arcpy 벡터의 외적을 이용한 두 벡터의 교차점 구하기 # 벡터의 외적 def cross_product(x0,y0,x1,y1, x2,y2,x3,y3): val = (x1-x0)*(y3-y2) - (y1-y0)*(x3-x2) return val # 두 벡터의 교차점 def intersection_point(x0,y0,x1,y1, x2,y2,x3,y3, val): pre = x1*y0 - y1*x0 post = x3*y2 - y3*x2 x = (pre * (x3-x2) - (x1-x0) * post) / val y = (pre * (y3-y2) - (y1-y0) * post) / val return x,y if __name__ == '__main__': for idx, row in enumaerat(arcpy.da.SearchCursor("폴리라인","SHAPE.. 2021. 8. 10. 이전 1 다음