danleyb2
8/15/2017 - 5:20 AM

Plot a given number of equally spaced circumferance cordinates on a x,y center with given radius

Plot a given number of equally spaced circumferance cordinates on a x,y center with given radius

import math
from math import pi


def points_on_circumference(center=(0, 0), r=50, n=100):
    return [
        (
            center[0]+(math.cos(2 * pi / n * x) * r),  # x
            center[1] + (math.sin(2 * pi / n * x) * r)  # y

        ) for x in xrange(0, n + 1)]


print points_on_circumference(center=(-10,-10),r=50)