Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Oct 7, 2020
Embed
What would you like to do?
def orbits(dist, offset=0, clr='white', wdth=2):
# Initialize empty lists for eac set of coordinates
xcrd=[]
ycrd=[]
zcrd=[]
# Calculate coordinates
for i in range(0,361):
xcrd=xcrd+[(round(np.cos(math.radians(i)),5)) * dist + offset]
ycrd=ycrd+[(round(np.sin(math.radians(i)),5)) * dist]
zcrd=zcrd+[0]
trace = go.Scatter3d(x=xcrd, y=ycrd, z=zcrd, marker=dict(size=0.1), line=dict(color=clr,width=wdth))
return trace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment