When drawing a circle using "with circles" or "object circle" with arc_start : arc_end, the result may not always be what you expect. Depending on the values arc_start, arc_end provided, the arc may not be drawn at all. Consider the following examples:
No. start : end result
------------------------------
1 0 : 360 full circle
2 10 : 370 nothing is drawn
3 360 : 720 nothing is drawn
4 -180 : 180 nothing is drawn
5 -360 : 0 nothing is drawn
6 360 : 0 nothing is drawn
7 0 :-360 nothing is drawn
Additionally, the current implementation considers an arc to be a full circle if the difference between start and end is very close to a multiple of 360 (within 0.1 degrees). However, this behavior is not clearly explained in the documentation, making it difficult for users to predict.
No. start : end result
------------------------------
8 0.1 : 360 full circle
9 0.2 : 360 arc
10 0.0 : 359.9 full circle
11 0.0 : 359.8 arc
12 180.1 : 540.0 full circle
13 180.2 : 540.0 arc
No. start : end result
------------------------------
14 0.0 : 0.1 full circle
15 0.0 : 0.2 arc
16 90.0 : 90.1 full circle
17 90.0 : 90.2 arc
18 -90.1 : -90 arc ?
19 -90.2 : -90 arc
Proposed Fix
I propose a clearer and more intuitive rule for determining when a full circle should be drawn:
Under this rule:
This approach makes the behavior of do_arc() more predictable and aligns better with user expectations.
Patch file: gnuplot_arc_full_circle.patch
Sample script: example.gp
I'm sorry.
Correction to the third table.