# Piecewise function of a pyramid surface

Can't find it anywhere but I'm looking for a function dependent on x and y that describe any point on the surface of a square pyramid.

For example:

f(x,y) =   1 if 0 < x < 1-y < 1
0 else


Gives me the following surface, the first picture. http://imgur.com/a/PH69N

I'm looking for the function that describes the pyramid surface in the second picture (sry forgot the axis but it is the same as the first picture). Really feels supereasy, I'm just stuck..

-

These are continuous piecewise affine functions. Remarkably, they all can be written in max min form with piecewise affine components. We have shapes of the form you are asking (pyramids) in

These are applications of known results to economics, but I'd like to note that the results are due to

V.V. Gorokhovik and O.I. Zorko, “Piecewise afﬁne functions and polyhedral sets,” Optimization, vol. 31, pp. 209–221, 1994.

and not to Ovchinakov as claimed by my paper.

Now for your particular pyramid: a) Let $f_1,f_2,f_3: \mathbb{R^2}\to \mathbb{R}$ be three affine functions each of the form $f_i(x,y)=\alpha_1 x \beta_2 y + \delta_i$. These define the surfaces of the pyramid. b) Let $g \mathbb{R^2}\to \mathbb{R}$ be the function $g(x,y)=0$.

Let $$f(x,y) = (\min_{i} f_i(x,y))\max g(x,y) =(\min_{i} f_i(x,y))^+$$ which is a an interesting call option.:-)

-