How to create a 3 parameter function that gets its maximum in the center of the cube? I have an problem where I have a 3 dimensional board, and I want to assign to the center of that cube (aka the board) maximum values and to the edges of the board lower values (preferably in a way so that the upper left side will get higher values then the lower right side) - so i have a cube with R rows, C columns and depth D. I have a coordinate inside the cube with coordinates (i,j,d), With the following constraint on the values  (0,0,0)<=(i,j,d)<(R,C,D). I want a function that will map each value (i,j,d) to distinct values between 0 inclusive to RCD non inclusive in a way that the medium of the cube will get the highest values, then the upper left side and then the lower right side. 

Let's assume each cell is identified by (i,j,d) and the maximum values are (I,J,D). Assume that i,j, and d start at 1, and that I, J, and D are odd so that there is a unique middle value on each axis, $M_I = (I+1)/2, M_J = (J+1)/2$, and $M_D = (D+1)/2$
Then the distance from the center, for example in i, is 
$$|i-M_I|$$
We can make the maximum value 1 in the center and apply a penalty for moving away. The simplest way to do this would be:
$$V = 1 - \frac{|i-M_I|}{3(I-M_I)} - \frac{|j-M_J|}{3(J-M_J)} -\frac{|d-M_D|}{3(D-M_D)} $$
But this is symmetric, with all the corners giving 0. If we want to introduce asymmetry, so that the upper left will be higher than the lower right, we can define
$$f(i-M_I) = i-M_I, for \ \ i\geq M_I$$
$$f(i-M_I) = \frac{2}{3}\left(M_I - i\right), for\ \ i<M_I$$
This function f is similar to the absolute value, but increases more slowly for negative values than positive ones, so we will get an asymmetric penalty like this:
$$V = 1 - \frac{f(i-M_I)}{3(I-M_I)} - \frac{f(j-M_J)}{3(J-M_J)} -\frac{f(d-M_D)}{3(D-M_D)} $$
