Now, I have thought about it, and found a way to calculate it.
One has to think of the corner piece as a piece of a pyramid. A pyramid is made up of a bortom square and four triangles of equal size.
If I can calculate the size of the triangles, I can just cut out what I need for a corner piece. Does this sound crazy?