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
评论列表
文章目录