Surface Integrals
Surface Integral Geometry
Draw a parametric surface with its normal. Flux also shows the vector field. Orbit, zoom, pan, and GLB export stay on the existing viewer.
Generate Graph draws surface_integral(1,(u,v,0),u,0,1,v,0,1) as the unit square in the plane z = 0. Normal arrows point in the direction of r_u × r_v. The value 1 is the area. Orbit, zoom, pan, and the existing GLB export stay on this viewer.
surface_integral(u+v,(u,v,0),u,0,1,v,0,1) uses the same square and the same positive area element. surface_flux((0,0,1),(u,v,0),u,0,1,v,0,1) adds the vector field (0, 0, 1), whose arrows agree with the upward normal, and the flux is 1. Toggling Surface normals or Vector field redraws only the arrows.
Equation
surface_integral(1,(u,v,0),u,0,1,v,0,1)
Graph preview
How a surface integral is formed
A scalar surface integral adds f times the area element on a parametric surface r(u, v). The tangent vectors are the partial derivatives r_u and r_v, and dS is the length of their cross product. Reversing a parameter bound does not change that positive area. Flux instead uses the vector r_u × r_v without taking its length, so the order of the parameters chooses the orientation. Reversing one parameter reverses the normal and changes the sign of the flux. surface_flux((P, Q, R), (x, y, z), ...) is that oriented integral. The word inward reverses one parameter bound. Any other orientation word is rejected.
The same engine still accepts the flat surface_integral and surface_integral_flux commands. A surface whose partial derivatives are parallel is degenerate: the area element is zero and the normal is undefined, so no value is returned. An exact double integral is preferred. A numerical value is shown only when the quadrature error is within tolerance, and a divergent integral is not given a finite answer. The surface is the existing parametric surface in the 3D viewer, with normal arrows. Flux can also draw the vector field. Orbit, zoom, pan, and the existing GLB export stay with that viewer.
Reading the input
surface_integral(1,(u,v,0),u,0,1,v,0,1)— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
Other versions of this example
These stay on this page so each version keeps the same explanation. Choose Try example to run a version in its Studio workflow, or copy it into the editable field below.
Unit square area
Expected value 1. The normal of r(u, v) = (u, v, 0) points upward and has length 1.
surface_integral(1,(u,v,0),u,0,1,v,0,1)
Scalar height
Expected value 1. The integrand is the parameter sum, and the area element is 1.
surface_integral(u+v,(u,v,0),u,0,1,v,0,1)
Upward flux
Expected value 1. The parameter normal and the field (0, 0, 1) point the same way.
surface_flux((0,0,1),(u,v,0),u,0,1,v,0,1)
Try a change
- Change surface_flux((0, 0, 1), (u, v, 0), u, 0, 1, v, 0, 1) to end with inward, or swap one parameter bound. The flux changes from 1 to -1. The scalar area stays 1.
- After Generate Graph, toggle Surface normals and Vector field. Normals follow r_u × r_v. The field arrows show F on the surface.
- Try surface_integral(1, (u, 0, 0), u, 0, 1, v, 0, 1). The partial derivatives are parallel, so the surface is degenerate and no area is returned.
Generate Graph draws the parametric surface in the existing 3D viewer. Normal arrows show the orientation. Flux can also draw the vector field. Orbit, zoom, pan, and the existing GLB export stay on that viewer. A degenerate parameterization is not drawn as a successful surface.