All problems
Surface Integral over Plane
Problem
Integrate z = a - b*x - c*y over the triangle T with vertices (0,0), (1,0), (0,1).
Using the triangle's centroid (1/3, 1/3) the integral is a/2 - b/6 - c/6. Given a, b, c, return the value of this integral.
Hint
The average of a linear function over a triangle is its value at the centroid.
Test cases
case 1
in: [1,1,1]
expected: 0.1666666666666667
case 2
in: [6,0,0]
expected: 3
case 3
in: [0,1,0]
expected: -0.16666666666666666
case 4
in: [2,3,3]
expected: 0
Starter codePython
def surface_integral_plane(a, b, c):
# Your code here
pass4 test cases · run your code against them in the editor