3d triangle in one equation without min or max

57 Views Asked by At

How can I graph a triangle in 3d with a single equation that does not use min, max, floor, ceil, or absolute value?

If you believe not possible, then the closest approximation (equation that roughly appears to be a 3d triangle) will do.

2

There are 2 best solutions below

0
On

(Too long for a comment.) In 2D the segment between $(x_0,y_0)$ and $(x_1,y_1)$ can be represented as $\,\sqrt{(x-x_0)^2+(y-y_0)^2} + \sqrt{(x-x_1)^2+(y-y_1)^2} = \sqrt{(x_1-x_0)^2+(y_1-y_0)^2}\,$.

Then the equation of a triangle with vertices $\,(x_k,y_k) \;\mid\; k=1,2,3\,$ could be written as:

$$ \prod_{1\le i \lt j \le 3} \left(\sqrt{(x-x_i)^2+(y-y_i)^2} + \sqrt{(x-x_j)^2+(y-y_j)^2} - \sqrt{(x_i-x_j)^2+(y_i-y_j)^2}\right) = 0 $$

The above can easily be extended to 3D, though I don't see any practical use for either.

3
On

Consider the example of triangle with vertices $(0,0,0)$,$(3,3,0)$ and $(-3,3,0)$

$$((x+y) (x-y)(y-3)(\sqrt{9-x^2- (y-3)^2}+1))^2+z^2=0$$ $a^2+b^2=0$ ensures that $a=0$ and $b=0$. Here $z=0$ denotes equation of plane of triangle. $x+y=0$,$x-y=0$ and $y=3$ are 3 planes that contain 3 lines of triangle. The square root is included to exclude points on the line not a part of triangle.