Equation for "square paraboloid".

169 Views Asked by At

Equation for paraboloid that looks something like this ...

enter image description here

... is simple. It's just $f(x,y) = x^2 + y^2$.

I don't know if there is better name than "square paraboloid". I didn't find any. But what I am looking for is and equation that will give me result like this:

enter image description here

(Note that this is and illustration, not the precise result).

I need it for computation in a shader. I will normalize it so that points that are outside a certain square give results bigger than 1, points inside give results smaller than 1 and points inside squares' border go smoothly from 0 to 1.

Thank you for your help.

2

There are 2 best solutions below

5
On BEST ANSWER

$$ f(x, y) = \left( \max ( |x|, |y| ) \right)^2 $$

1
On

Draw the level curves of $$f(x,y) = \max\{|x|,|y|\}.$$