coding in python…
Below is what I have done but it doesn’t work…I need help with#part2 cause it doesn’t work for my test case ofk=[[(0,0),(1,0),(0,1)],[(2,5),(3,1),(2,2)]] which should returnjlist=[1,-3]
#part1
def jacobian(pts):
ptA = pts[0]
ptB = pts[1]
ptC = pts[2]
jac =(ptB[0]-ptA[0])*(ptC[1]-ptA[1])-(ptC[0]-ptA[0])*(ptB[1]-ptA[1])
return jac
#test case
#m=[(0,0),(1,0),(0,1)]
#jacobian(m)
#output: 1
#works as expected
#part2
def jacobianlist(k):
jlist = []
for i in range(len(k)):
jacobian(i)
jlist.append(jlist)
Expert Answer
An answer will be send to you shortly. . . . .