sample.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:groundfailure 作者: usgs 项目源码 文件源码
def createCirclePolygon(h, k, r, dx):
    """Create shapely polygon of a circle.

    usage: p = createCirclePolygon(h, k, r, dx)

    Args:
        h: x coordinate of center.
        k: y coordinate of center.
        r: radius of circle.
        dx: approximate distance between points * 10.

    Returns:
        Tuple (x, y) of numpy arrays of x and y coordinates of points.
    """
    D = 10.0
    theta = 2 * np.arccos((r - (dx / D)) / r)
    npoints = int(360.0 / theta)
    x, y = getPointsInCircum(r, n=npoints, h=h, k=k)
    p = Polygon(list(zip(x, y)))
    return p
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号