![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 53
Coding_Dreaming
这个作者很懒,什么都没留下…
展开
-
已知线段端点坐标,求线段上等距离的点坐标序列
已知线段上端点坐标,求其上等距离的点坐标序列:def points(m1,m2,n1,n2): q1 = Point(m1,m2) q2 = Point(n1,n2) len12 = ((p1.x-p2.x)**2+(p1.y-p2.y)**2)**0.5 n1 = int(len12/10) t12x = (10*(p2.x-p1.x))/len12原创 2016-02-21 22:11:54 · 4134 阅读 · 0 评论 -
判断四边形凹凸性及凹点
已知四边形四个点坐标 p1 = (x,y), p2 = (x,y), p3 = (x,y), p4 = (x,y) 判断凹凸性及凹点位置 t1 = (p4.x-p1.x)(p2.y-p1.y)-(p4.y-p1.y)(p2.x-p1.x) t2 = (p1.x-p2.x)(p3.y-p2.y)-(p1.y-p2.y)(p3.x-p2.x) t3 = (p2.x-p3.原创 2016-02-21 21:41:47 · 9835 阅读 · 3 评论 -
已知四边形四个顶点坐标,求面积
def calcArea(m1,m2,n1,n2,j1,j2,k1,k2): q1 = Point(m1,m2) q2 = Point(n1,n2) q3 = Point(j1,j2) q4 = Point(k1,k2) d12 = calcDistance(q1.y, q1.x, q2.y, q2.x) d23 = calcDistanc原创 2016-02-21 21:13:04 · 19753 阅读 · 0 评论 -
已知两点经纬度坐标,求其直线距离
def calcDistance(Lat_A, Lng_A, Lat_B, Lng_B): ra = 6378.140 # 赤道半径 (km) rb = 6356.755 # 极半径 (km) flatten = (ra - rb) / ra # 地球扁率 rad_lat_A = radians(Lat_A) rad_lng_A = radia原创 2016-02-21 21:05:35 · 1736 阅读 · 0 评论 -
已知两条直线上各两点坐标,求两条直线交点坐标
def point(x0,y0,x1,y1,x2,y2,x3,y3): a = y1-y0 b = x1*y0-x0*y1 c = x1-x0 d = y3-y2 e = x3*y2-x2*y3 f = x3-x2 y = float(a*e-b*d)/(a*f-c*d) x = float(y*c-b)/a原创 2016-02-21 20:59:54 · 9317 阅读 · 3 评论