# Piecewise function of a pyramid surface [closed]

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..

-

## closed as off-topic by Yemon Choi, Stefan Kohl, Ricardo Andrade, Felipe Voloch, John PardonNov 17 at 0:19

This question appears to be off-topic. The users who voted to close gave these specific reasons:

• "This question does not appear to be about research level mathematics within the scope defined in the help center." – Ricardo Andrade, Felipe Voloch, John Pardon
• "MathOverflow is for mathematicians to ask each other questions about their research. See Math.StackExchange to ask general questions in mathematics." – Yemon Choi, Stefan Kohl
If this question can be reworded to fit the rules in the help center, please edit the question.

This is algebraic geometry? -- Hmm ... –  Stefan Kohl Nov 16 at 21:09

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.:-)

-