All problems
Curl of 3D Vector Field
Problem
For the vector field F(x, y, z) = [a*y*z, b*z*x, c*x*y], compute the full curl vector at (x, y, z).
curl F = [dR/dy - dQ/dz, dP/dz - dR/dx, dQ/dx - dP/dy] = [x*(c - b), y*(a - c), z*(b - a)].
Hint
Each curl component pairs one partial of the field components in cyclic order.
Test cases
case 1
in: [1,1,1,2,3,4]
expected: [0,0,0]
case 2
in: [1,2,3,1,1,1]
expected: [1,-2,1]
case 3
in: [0,0,1,2,0,5]
expected: [2,0,0]
case 4
in: [2,-1,4,0,3,2]
expected: [0,-6,-6]
Starter codePython
def curl3d(a, b, c, x, y, z):
# Return the curl vector
# Your code here
pass4 test cases · run your code against them in the editor