# How to plot a region defined by corner points

As we know,t1*p1 + t2*p2 + t3*p3 is a triangle region whose vertice is {p1,p2,p3} when t1+t2+t3==1 and 0<t1<1&&0<t2<1&&0<t3<1.But I don't know how to draw this triangle?I just can estimate it with some points like

SeedRandom
{p1, p2, p3} = RandomReal[1, {3, 3}];
t = Normalize[#, Total] & /@ RandomReal[1, {400, 3}];
Graphics3D[{PointSize[.02],
Point[Dot @@@ Tuples[{t, {{p1, p2, p3}}}]], Red,
Point[{p1, p2, p3}]}] But how to plot it with a shape?If I use ParametricRegion,it will be a parallelogram

Region@ParametricRegion[
t1*p1 + t2*p2 + (1 - t1 - t2)*p3, {{t1, 0, 1}, {t2, 0, 1}}]~Show~
Graphics3D[{PointSize[.02], Point /@ {p1, p2, p3}}]


How to implement it?

• You need RegionFunction for plotting in barycentric coordinates: ParametricPlot3D[{u, v, 1 - u - v}.{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}}, {u, 0, 1}, {v, 0, 1}, RegionFunction -> Function[{x, y, z, u, v}, u + v <= 1]] – J. M. will be back soon Apr 3 '17 at 17:46
• @J.M. Thanks,I think it deseve an answer,and I will open it to wait other solution. – yode Apr 3 '17 at 17:53
• Why not just Region[Simplex[{p1,p2,p3}]? – kglr Apr 3 '17 at 22:40
• @kglr Fun,I just guess that t1+t2+t3==1 is a triangle,and want to plot it to comfirm.If I change it into t1+t2+t3==2,you cannot use Simplex anymore. :) – yode Apr 3 '17 at 22:52
• Or Graphics3D[Polygon[{p1,p2,p3,p1}]] – David G. Stork Apr 3 '17 at 23:17

Perhaps:

reg[p1_, p2_, p3_] :=
Show[ParametricPlot3D[{u, v, 1 - u - v}.{p1, p2, p3}, {u, 0, 1}, {v,
0, 1 - u}, Mesh -> None],
Graphics3D[{Red, PointSize[0.04], Point[{p1, p2, p3}]}]]


e.g.

Grid[Partition[reg @@@ RandomInteger[10, {9, 3, 3}], 3]] David G. Stork (in the comments) points out: Polygon[{p1,p2,p3}] or Triangle[{p1,p2,p3}are simpler options.