What I would like to do is create an irreguar 2d shape preferably using some mathematical function. Is this possible?

I would then like to apply some function to each x,y pair in this shape to generate some z values for each point

Could anyone recommend a way of doing this