A
A
Alexey Nikolaev2016-11-06 01:59:58
Programming
Alexey Nikolaev, 2016-11-06 01:59:58

What algorithm can be used to evenly distribute a set of particles around a given point?

Goodnight.
There are N geometric shapes (rectangles, for simplicity), and a point X. How, without reinventing the wheel, is it correct and rational to place all geometric shapes in such a way that they are evenly distributed along the plane around this point without intersecting each other? In other words, the question is: what algorithms can be used for this (in particular, for calculating the coordinates of a figure on a plane), perhaps there are ready-made implementations in the form of libraries?
I am not strong in mathematics and algorithms of this level.
Thanks in advance.
PS We are talking about web programming in general and about php in particular, but I don't think that this is the point.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2016-11-06
@Heian

To create diagrams: here
The sum of all the angles of the figures at the connection point must be 360 ​​degrees and there should be no intersections and voids.
And then - bust.
For example, for 4 squares: this is a 2x2 field, where the center of a given point (around which we place objects) is located exactly at the point where the corners of all these 4 squares touch (exactly in the center), because 90 degree angles: 4*90=360

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question