Division of a rectangle starting from a defined point inside the rectangle
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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
Walter Roberson
on 10 May 2018
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?
Omar Shadeed
on 10 May 2018
Walter Roberson
on 10 May 2018
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.
Omar Shadeed
on 10 May 2018
Walter Roberson
on 10 May 2018
Do diagonal connections count as being part of the same piece, or does it have to be 4-connection (left/right/top/bottom) ?
Omar Shadeed
on 11 May 2018
Image Analyst
on 11 May 2018
Like I said below, why can't you use linspace()?
Answers (1)
Image Analyst
on 11 May 2018
0 votes
Sounds like you can use linspace().
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!