Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a piece-wise 2-input function that I would like to repeatedly tile diagonally across a grid. See this image.

alt text

So here, I know the equations of the pink, blue and green areas in the range 0 - 2.

My problem is that I'm having trouble finding a way to tile the function diagonally across like shown in the image by transforming the inputs. I tried using $\mod (x_1 = x_1 \mod 2, x_2 = x_2 \mod 2)$ to transform the input, and it worked somewhat, but it was wrong at grids $(2-3, 1-2)$, $(1-2, 2-3)$, $(4-5, 3-4)$ and $(3-4, 4-5)$.

Any help is appreciated!

share|cite|improve this question
It is not really clear what you are asking. Perhaps explain what you mean by "equation of pink etc in range 0-2"? What is x_1, x_2 etc – Aryabhata Nov 5 '10 at 2:18
x1, and x2 are the axes, and inputs to the function. Probably should have used x and y instead. By equation of pink, i meant some 2-input function e.g. x1*x2 defined from 0 - 1 as shown on the image. And similarly I have different 2-input equations for the first green and blue blocks in the lower left. – Projectile Fish Nov 5 '10 at 2:59
up vote 3 down vote accepted

Let $F$ be the original functions, $f$ the new one. Define

$f(x,y) = F(x-m,y-m)$ where $m = \min(\lfloor x \rfloor, \lfloor y \rfloor)$.

share|cite|improve this answer
Ah, thanks. So simple, but I never would have got it! – Projectile Fish Nov 5 '10 at 2:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.