mash of dots in rhombus shape

I really need help.
I menaged to create mash of dots with two FOR loops.
Dots are in positions (-5,-5), (-5,-3),(-5,-1),(-5,1),(-5,3),(-5,5) etc untill (5,3),(5,5)... so dots are in corners of squares.
I have to create mash of dots but they have to be in corners of rhombus like on pictures that I attached:
https://ibb.co/gGYcDF
One note: It is easier to rotate this picture counterclockvise for 45 degrees.
Last edited on
One way to do it is to make the square that is the smallest square that can contain the rhombus. Then you can iterate over all the points in the square and check each one to see if it is also inside the rhombus by checking if its on the inside of each of the 4 lines that define the shape.

That is brute force, and simple.

Topic archived. No new replies allowed.