|
From: Nikita Z. <coo...@ma...> - 2022-11-30 05:17:49
|
I tried to plot «sqrt( sin(x) )» and noticed, that at 1000 samples with xrange [-8:8] lines break at visible distance from X axis. Even 10000 samples is not enough, and only 100k or 1m samples is more or less fine. Of course, it’s not good for vector documents like svg, eps or whatever latex terminals generate. This problem of open ends could solved by adding point between existing and non-existing neighbor points and adjusting its place with subdivide and conquer approach. Ideally this point could use one of reserved position for non-existing point, thus reducing chance of points number growth. Also, if points number growth is not problem, there could be second threshold to use for middle subdivisions, just to keep visually good resolution. This would allow to use minimum necessary points in the best way. In case if threshold for middle subdivisions is not specified, it could be calculated horizontal distance (may be multiplied by 2). -- Nikita Zlobin |