Skip to main content
5 of 5
use coordinate tuples; allow to work for Python 3
Mike T
  • 42.4k
  • 10
  • 129
  • 190

Here's a solution for the trigonometry in Python (credit to my wife, who pointed out the problem was an ellipse, not a circle):

# FunkyEllipse.py

import math

n_dist=5000
e_dist=2000
s_dist=1500
w_dist=1000

distV=[n_dist,e_dist,s_dist,w_dist,n_dist]
radix=0

nverts=120              #!! Must be evenly divisible by 4!
quad=nverts / 4

step=(math.pi * 2) / nverts
stepSin = math.sin(step);
stepCos = math.cos(step);

acc1   = 1.0            # Cos(90)
acc2   = 0.0            # Sin(90)
coords = []
for i in range(0,nverts):
    if ((radix % 2) == 0):
        x = acc2 * distV[(radix+1)%4]
        y = acc1 * distV[radix%4]
    else:
        x = acc2 * distV[radix%4]
        y = acc1 * distV[(radix+1)%4]

    coords.append((x, y))

    if ((i % quad) == (quad - 1)):
        radix += 1

    temp = (acc1 * stepCos) - (acc2 * stepSin)
    acc2 = (acc2 * stepCos) + (acc1 * stepSin)
    acc1 = temp

coords.append(coords[0])
print(coords)

Which generates a shape which looks like: enter image description here

Incorporating the math in an arcpy script to copy a point featureclass to polygon is left as an exercise.

Vince
  • 20.3k
  • 16
  • 48
  • 65