def lines_len_in_circle(r, font_size=12, letter_width=7.2):
"""Return the amount of chars that fits each line in a circle according to
its radius *r*
Doctest:
.. doctest::
>>> lines_len_in_circle(20)
[2, 5, 2]
"""
lines = 2 * r // font_size
positions = [
x + (font_size // 2) * (-1 if x <= 0 else 1)
for x in text_y(lines)
]
return [
int(2 * r * cos(asin(y / r)) / letter_width)
for y in positions
]
评论列表
文章目录