how to build a formula for calculation / coefficient(s) for set of descending numbers I have been years away from my math class. Now I would like to figure out the following.
I am writing a simple javascript program where some tabular data is output to PDF file.
The program will automatically decide if to output the data in portrait or landscape layout.
User will have the ability to choose size of the font.
Based on the size of the font and the number of characters in the widest tabular data row,
the program will calculate whether portrait of landscape layout to apply.
I checked how many characters can be output per line under a specific font.
Here is the result:




Font size
Characters
Ratio
Ratio calc
Notes




4
200
50.0
(200 / 4)



6
130
21.7
(130 / 6)



8
100
12.5
(100 / 8)



10
80
8.0
(80 / 10)



12
65
5.4
(65 / 12)



14
56
4.0
(56 / 14)



16
50
3.1
(50 / 16)



18
43
2.4
(43 / 18)



20
38
1.9
(38 / 20)



22
35
1.6
(35 / 22)



24
32
1.3
(32 / 24)



26
30
1.2
(30 / 26)



28
28
1.0
(28 / 28)



etc
etc
etc






We can see the quantity of characters is lower with increased size of the font.
But the ratio is not symmetrical. I can simply create a table for this where the program would lookup the result,but it would be more efficient to have a simple formula that would calculate the result.
For example, if user supplies font size 10, the formula calculates the answer of close to: 80.
If the user chooses font size 26, the formula calculates the answer of around: 30.
What would be a mathematical approach to the calculation / formula / coefficients for this?
(If possible, please try to present the answer in terms of JavaScript Math() functions or similar - but not necessary).
 A: Thanks to @Raymond Chen here is the logic for his answer in which he turned my thinking 180 degrees around.




Font size
Characters
Product
Product calc
Notes




4
200
800.0
(4 x 200)



6
130
780.0
(6 x 130)



8
100
800.0
(8 x 100)



10
80
800.0
(10 x 80)



12
65
780.0
(12 x 65)



14
56
784.0
(14 x 56)



16
50
800.0
(16 x 50)



18
43
774.0
(18 x 43)



20
38
760.0
(20 x 38)



22
35
770.0
(22 x 35)



24
32
768.0
(24 x 32)



26
30
780.0
(26 x 30)



28
28
784.0
(28 x 28)



etc
etc
etc
etc





The product of the multiplications shows as the target size of a line - around 800. Now we can simply apply coefficient 800 and divide it by the font size and get the approximate number of characters. Good thinking @Raymond Chen.
A: You can make it a bit better using a constant equal to $792.2$ corresponding to $\sigma=3.6$.
$$\left(
\begin{array}{cccc}
x & y & y_{800} & y_{792.2} \\
 4 & 200 & 200 & 198 \\
 6 & 130 & 133 & 132 \\
 8 & 100 & 100 & 99 \\
 10 & 80 & 80 & 79 \\
 12 & 65 & 67 & 66 \\
 14 & 56 & 57 & 57 \\
 16 & 50 & 50 & 50 \\
 18 & 43 & 44 & 44 \\
 20 & 38 & 40 & 40 \\
 22 & 35 & 36 & 36 \\
 24 & 32 & 33 & 33 \\
 26 & 30 & 31 & 30 \\
 28 & 28 & 29 & 28
\end{array}
\right)$$
