X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,10b7bb932d0a9609 X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 2001-04-07 04:26:02 PST Path: supernews.google.com!sn-xit-03!supernews.com!nntp.cs.ubc.ca!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.rz.uni-karlsruhe.de!not-for-mail From: Markus Gebhard Newsgroups: alt.ascii-art Subject: Re: New Version released - TONS of suggestions Date: Sat, 07 Apr 2001 13:23:55 +0200 Organization: University of Karlsruhe, Germany Lines: 57 Message-ID: <3ACEF8CB.5F3DCBE5@rz.uni-karlsruhe.de> References: <3AC99B70.E4C0C49C@rz.uni-karlsruhe.de> <9agj8a$bsd$1@news.inet.tele.dk> <3ACCCF07.F41D247C@rz.uni-karlsruhe.de> <986504967.2915@itz.pp.sci.fi> NNTP-Posting-Host: wn4-jarjar.wn4.uni-karlsruhe.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.rz.uni-karlsruhe.de 986642585 7011 172.20.12.141 X-Complaints-To: usenet@rz.uni-karlsruhe.de X-Mailer: Mozilla 4.77 [en] (Win98; U) X-Accept-Language: en Xref: supernews.google.com alt.ascii-art:5149 Ilmari Karonen wrote: > > In article <3ACCCF07.F41D247C@rz.uni-karlsruhe.de>, Markus Gebhard wrote: > > > >You are right - but can you provide an algorithm that draws good circles > >(in any size)? > > You can already draw lines, right? First divide the circle into four > quadrants: left, right, top, bottom. Basic trigonometry should tell you > where each quadrant begins and ends, and also let you compute the height > of the arc for each character between the beginning and the end. Then > you just have to "connect the dots". > > Actually, you _could_ do Bezier curves that way too.. That works fine for raster graphics and I have tried to apply those algorithms (bresenham etc.) to ascii. The algorithms work fine as long as you take one character as one pixel (and ignore antialiasing): XXXXXXXXXXX XX XXX XXX XXXX X X XXXX X X XXX X X XXXX XXX XXX XXX XXXX XXXXXX XXXXXXXXXXX XX XXX But it does not work any longer if you want to use it for lines: ,---------. .' ,-' '-. _.-' / \ _.-' ( ) .-' \ / _.-' .-' '-. ,-' _.-' _..--' '---------' .' .-' The ellipse is ugly (but by far better than in previous versions of Jave) and the lines do not look straight... By lots of work and hundreds of lines of code I optimized the lines, so the lines above became: .-' _.-' .-' .-' .-' _.-' _.-' _.-' .-' _.-' For horizontal lines there are at least 4 levels of height you can use: __ .. -- ''/"" For vertical lines it is not that easy, there is only one (it is different in JFL style): | (that can be transformed to ,' as the angle increases). So using my line algorithms for drawing ellipses will only produce good results for the rather horizontal parts at the top and bottom, but it will produce trash for rather vertical parts :-( Anyway I will try your suggestion for large ellipses - it could work there but I am pretty sure it will not work with smaller ones. Anybody out there with other ideas or experiences about algorithms for ellipses?