Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: "Charles Nicholson" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Bresenham and his mates.... Date: Fri, 29 Jan 1999 15:48:27 -0500 Organization: SCEA News Server Lines: 150 Message-ID: <78t687$1as7@scea> References: <36B1FF9D.B55ED267@cwcom.net> NNTP-Posting-Host: chnicholson.vassar.edu Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0019_01BE4B9E.D00A3B40" X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 This is a multi-part message in MIME format. ------=_NextPart_000_0019_01BE4B9E.D00A3B40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm assuming that you know what the radius of your circle is. If i was = doing it, i'd keep a variable theta that represents the number of = degrees (i.e, at point B theta would equal 90). Then, adjust theta so = that the ray extends through point c. The coordinates of c are=20 x =3D radius * cos(theta) y =3D radius * sin(theta) i guess lookup tables and the like would speed things up a fair amount = too. hope i helped... -charles ps. bresenham? Maybe Hardenburgh....he did more w/circles.... :) but = maybe i'm just nitpicking... Quick question.....=20 I have a circle at point 0,0, with a radius of 10 (example). OK, a = bit like this :(Use fixed width font!)=20 =20 xBx=20 xx xn <----Point n=20 x x=20 x x=20 x c x - Sposed to be 10 high, but I'm crap = at this!=20 x x=20 x x=20 xx xx=20 xxx=20 Here is my problem. If point 'c' is at 0,0, how do I calculate = where point n is (ie what is it's x and y values?) from point c.=20 The idea is, when the user presses 'right', the line start off from = 0,0 to point B, and goes right to point n. (from c)=20 I hope you get what I mean - I spose the nearest example would be a = clock!!!!=20 Cheers!=20 Tones 8)=20 ------=_NextPart_000_0019_01BE4B9E.D00A3B40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm assuming that you know what the = radius of=20 your circle is.  If i was doing it, i'd keep a variable theta that=20 represents the number of degrees (i.e, at point B theta would equal = 90). =20 Then, adjust theta so that the ray extends through point c.  The=20 coordinates of c are
 
x =3D radius * cos(theta)
y =3D radius * sin(theta)
 
i guess lookup tables and the like would speed = things up a=20 fair amount too.
 
hope i helped...
-charles
 
ps. bresenham?  Maybe Hardenburgh....he did = more=20 w/circles.... :) but maybe i'm just nitpicking...

Quick question.....=20

I have a circle at point 0,0, with a radius of 10 = (example). =20 OK, a bit like this :(Use fixed width font!)=20
 =20 =

           =         =20 xBx=20 =
           = ;      =20 xx   xn    <----Point n=20 =
           = ;     =20 x       x=20 =
           = ;    =20 x         x=20 =
           = ;    =20 x    c    x    - Sposed = to be=20 10 high, but I'm crap at this!=20 =
           = ;    =20 x         x=20 =
           = ;     =20 x       x=20 =
           = ;      =20 xx   xx=20 =
           = ;        =20 xxx=20

Here is my problem.  If point 'c' is at 0,0, how do I = calculate=20 where point n is (ie what is it's x and y values?) from point=20 c.=20

The idea is, when the user presses 'right', the line start = off from=20 0,0 to point B, and goes right to point n. (from c)=20

I hope you get what I mean - I spose the nearest example = would be a=20 clock!!!!=20

Cheers!=20

Tones 8)

------=_NextPart_000_0019_01BE4B9E.D00A3B40--