- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
This may seem like an odd question but I've got an application for it.
My instances would be Jass rects (making sub-rects out of a giant rect).
I need to take a square (or otherwise regular quadrilateral) and divide it up into n-sub quadrilaterals whose total area encompasses exactly that square.
Parameters:
1) The big square and its dimensions
2) n, the number of sub-sections to make
Optional parameters
3) the minimum size of each subsection (so for example it doesn't do something like 2 giant rectangles and one super tiny small one)
4) maximum size of each subsection (so we don't get super giant quadrilaterals with very many tiny ones).
returns a set of quadrilaterals whose coordinates/area exactly encompasses the original square.
Picture below for n = 8. Obviously there are many possible divisions (I don't think there's an infinite amount for each n though, but I keep changing my mind...), and the algorithm should be non-determinsitic/random, but having some of the optional parameters should help stop wacky things.
Also, what would be the equation to get the total possible combinations of divisions for each n (or is it iinfinite for n > 1?).
e.g.
n = 1 --> (1) there is a single possible division (namely making a square the same size as the original rect)
n = 2 --> (???) I can imagine many ways to do this (but how many exactly?!)
This may seem like an odd question but I've got an application for it.
My instances would be Jass rects (making sub-rects out of a giant rect).
I need to take a square (or otherwise regular quadrilateral) and divide it up into n-sub quadrilaterals whose total area encompasses exactly that square.
Parameters:
1) The big square and its dimensions
2) n, the number of sub-sections to make
Optional parameters
3) the minimum size of each subsection (so for example it doesn't do something like 2 giant rectangles and one super tiny small one)
4) maximum size of each subsection (so we don't get super giant quadrilaterals with very many tiny ones).
returns a set of quadrilaterals whose coordinates/area exactly encompasses the original square.
Picture below for n = 8. Obviously there are many possible divisions (I don't think there's an infinite amount for each n though, but I keep changing my mind...), and the algorithm should be non-determinsitic/random, but having some of the optional parameters should help stop wacky things.
Also, what would be the equation to get the total possible combinations of divisions for each n (or is it iinfinite for n > 1?).
e.g.
n = 1 --> (1) there is a single possible division (namely making a square the same size as the original rect)
n = 2 --> (???) I can imagine many ways to do this (but how many exactly?!)
Last edited: