# Libgdx drawing a circle with large radius causes exception

When drawing a circle using the ShapeRenderer and using a really big radius (in millions, planet/sun size, given in metres) libgdx throws an exception

Exception in thread "LWJGL Application" java.lang.ArrayIndexOutOfBoundsException: 20003

The number of segments used to draw a circle is something like 6 × cube root (radius). This means for a sufficiently large radius you will break the number of allocated vertices in the ShapeRenderer, which is defaulted to 5000 I think.
One approach could be to scale everything down by some factor before drawing it. Another approach would be to use the other overload of circle that accept an argument that indicates the number of segments to use and tweak that value.