Phil,
jdaw1 wrote:[ [0 2] [2 2] [4 2] [6 2] [0 1] [3 1] [6 1] [0 0] [3 0] [6 0] ]
jdaw1 wrote:
jdaw1 wrote:However, I do agree that it would be neater if the two A1s touched. But how should that be expressed that in the parameter?
Idea!
Currently the array contains items of the form
[ x y ]. Perhaps, also allowed, could be
[ x y x1 y1 ]. As now, glasses are placed at (
x y), and then the code chooses
jdaw1 wrote:the radius and separately scale the x and y directions such that things fit as snugly as possible, obviously subject to the other upper bounds on the radius.
The radius chosen, those of the new form are then moved along the straight line from (
x y) to (
x1 y1), as far as possible without crashing into another circle. This will be done pairwise, each circle being moved a proportion
p along the line,
p chosen to be the lesser of 1 and first crash. Each circle will be moved the least of its pairwise
p’s. (This is robust and simple, but wouldn’t handle complicated sequences of possible collisions.)
So
[ [0 2] [2 2 3 2] [4 2 3 2] [6 2] [0 1] [3 1] [6 1] [0 0] [3 0] [6 0] ] would make the two A1s touch.
Objections?