diff --git a/curves/sim.py b/curves/sim.py index eba9ab8..74e4b17 100644 --- a/curves/sim.py +++ b/curves/sim.py @@ -1,7 +1,29 @@ import pandas as pd +import math def circle(radius: float, n_points: int) -> pd.DataFrame: - # Returns a dataframe with columns `x` and `y` - # These are the co-ordinates of points on a circle of - # specified radius, with n_points evenly spaced - pass \ No newline at end of file + """ + Generate a circle of points. + + Returns a dataframe with columns 'x' and 'y' corresponding to + points uniformly spaced in a circular formation. + + Parameters + ---------- + radius : float + The radius of the circle + n_ponts : int + The number of points that the circle should be + comprised of. + + Returns + ---------- + out : pandas.DataFrame + Dataframe containing columns 'x' and 'y' as coordinates + for points on the circle. + + """ + + points = [(math.cos(2*math.pi/n_points*x)*radius,math.sin(2*math.pi/n_points*x)*radius) for x in range(0,n_points+1)] + df = pd.DataFrame(data=points, columns=['x','y']) + return df \ No newline at end of file