# Surface plot over a triangular definition area

How do I illustrate the surface $f(x,y)=xy(x-y)$ over the area enclosed by the lines $y_1=2x$, $y_2=1-4x$, and $y_3=4+x/2$? TIA.

• Plot3D with options RegionFunction? May 1 '18 at 21:16
• reg = ImplicitRegion[2 x<=y && 1- 4 x<=y && 4 +x/2>=y, {x,y}]; Plot3D[x y (x-y), {x, y} \[Element] reg] ?
– kglr
May 1 '18 at 21:24
• I don't know if it is proper etiquette, but I use a comment anyway to send a Thanks! to all for the solutions. There are some interesting versions here that I've never seen and which inspires me to look more into the various suggested techniques.
– MF92
May 3 '18 at 21:00

Plot3D[x y (x - y),

triangle = Polygon[Join @@ ({x, y} /. Solve[Thread[# == y], {x, y}] & /@