Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168738
Image: ubuntu2004
x, y = var('x, y')
def nrmsquirt(x,y): return sqrt(x^2 + y^2)
def EL(A,m,n,d): B=[A[0]] v=[-d] t=1/n for h in range(1,n): B.append([h*t*A[0][0]+(1-h*t)*A[1][0],h*t*A[1][1]+(1-h*t)*A[0][1]]) for j in range(1,m): for k in range(1,n): B.append([k*t*A[j-1][0]+(1-k*t)*A[j][0],k*t*A[j-1][1]+(1-k*t)*A[j][1]]) for r in range(1,n): B.append([h*t*A[m][0]+(1-h*t)*A[0][0],h*t*A[0][1]+(1-h*t)*A[0][1]]) for i in range(0,m): v.append(sqrt((x-B[i][0])^2+(y-B[i][1])^2)) return sum(v)
contour_plot(EL([[-1,0],[-1,2],[1,1],[1,0]],4,2,0),(x,-2, 2), (y,-2, 2),contours=30,plot_points=100)
range(0,3)
[0, 1, 2]