EDIT :
After reading the comments, I understood that in fact, my question was not so clear . so I will put it in simple terms of programming :
First Scenario :
My Input :
$a = Plane area
[ nominally X,Y ] .
$r == Circles
( "dots" or "discs" ) Diameter or radius [r or d].
$per == Wanted Coverage in percentage
.
( desired ) Output :
An array of aligned ( x-axis && Y-axis ) circles with given radius ( $r
) distributed in $row,$column to cover the exact wanted percentage ( $per
) .
$d_y == $d_x == distance in horizontal,vertical
( uniform distance for $row
, $column
)
Unknown :
$d_y == $d_x == distance in horizontal,vertical
Problem :
Given $a
, $r
and $per
, what are the distribution distances between the circles ( $d_y
, and $d_x
) that will result in a coverage of exact $per
of $a
.
Second Scenario ( derivative )
Input :
$a = Plane area
[ nominally X,Y ] .
$d_y, $d_x = Distances between circles
( "dots" ) on x
, y
axis .
$per = Wanted Coverage in percentage
.
( desired ) Output :
An array of aligned ( x-axis && Y-axis ) with radius $r
circles with the given distances between $row
and $column
, that will result in a coverage of exact $per
of $a
.
Problem :
Given $d_y
, and $d_x
, What is the Circle's ( "dots" or "discs" ) Diameter or radius [$r
or d
] that will result in a coverage of exact $per
of $a
.
Unknown :
$r = Circle's diameter or radius
.
Original Question :
So, first, I am not a mathematician, and I only encounter kids-level math on my daily work when programming.
I need to write a simple CAD macro that given a wanted percentage coverage of a plane, and the diameter ( or radius ) of a "dot", actually a circle , will distribute the points in such distances to allow the exact wanted coverage percentage .
In other words : given the percentage of wanted coverage , circles size and plane size , what is the distance between the points ( straight line circumference , not center if possible )
Given Y,X of a plane and [r] of circle, and wanted coverage percentage of plane by "dots" or circles ( say 32% ) how to know the distance D[H] - horizontal and D[V]- vertical
I know I also need to assume that the "dots" center in edge rows are on the edge itself, or alternative the distance from edges is equal to the distance between them ..
If it were a square and not a circle, I could have managed with very simple calculations . But now I am not sure of myself . Does calculating the circle area πr2 and subtracting from the coinciding square and then distribute the squares will work ? (Later I also need the reverse - given the distances and the percentage - calculate the circles diameter ( or r )
( I found this "circle packing" article on wikipedia - but it does not address the wanted distances )
last Edit ( result )
I ended up using some combination of the first answer by Kimchi lover and second Ross Millikan .
Both valid as far as my non-mathematical self can understand .(too bad can only accept one .. )
I thought I would post The result ( which is not final - but works ) , so to show what your help produced :
So thanks again ..