Division of a rectangle starting from a defined point inside the rectangle

Hi everyone, I'm trying to divide a rectangle into n equal parts but starting from a defined point inside the rectangle. I have been able to divide it into n parts but now I want to do the same thing but starting from a point inside the rectangle. Thanks for your help.

7 Comments

Are the equal parts required to be rectangular themselves? Are they required to be convex? Are they required to be identical?
When you say that it starts at a defined point, does that mean that the point just has to be on an edge of one of the pieces, or that it has to be one of the vertices?
The equal parts have to be identical in the area with no other restrictions. That defined point has to be one of the vertices yeah
Do you need this as a theoretical division (continuous coordinates) or as an approximate division of a raster rectangle (each whole pixel belonging to one of the pieces, as equal as practical taking into account that the area might not be exactly divisible by n) ?
The raster version is perhaps easier to implement.
Ah, I just thought of a way for continuous coordinate: make the designated point the vertex around which you create "wedges" of the rectangle, each 1/n'th of the area. This would require a bit of care for the case where the wedge has to include a corner... I think it just might be possible that in some cases the wedge has to include two corners.
I want it as an approximate division of a raster rectangle. The main thing is that these areas have to be equal to each other.
Do diagonal connections count as being part of the same piece, or does it have to be 4-connection (left/right/top/bottom) ?
Like I said below, why can't you use linspace()?

Answers (1)

This question is closed.

Asked:

on 10 May 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!