1. Calculating points in a circle

This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C4C417.A1C65C80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Hello all,

Here is a question for those with more mathematical knowlege than I possess
[almost anyone]:

Is there a formula for determing the X, Y points on the screen around the
circumference of a circle if its radius and center point is known?

This sort of thing has me waking up with night sweats ^__^;;

Thanks in advance,
David S.


---
Outgoing mail is certified Virus Free unless this too is a virus.....hmmmm.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004

------=_NextPart_000_0006_01C4C417.A1C65C80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3103.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello all,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Here is a question for those with more mathematical
knowlege than I possess [almost anyone]:<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Is there a formula for&nbsp;determing the X, Y 
points on the screen around the circumference of a circle if its radius and 
center point is known?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>This sort of thing has me waking up with night 
sweats ^__^;;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>David S.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><BR>---<BR>Outgoing mail is certified Virus Free 
unless this too is a virus.....hmmmm.<BR>Checked by AVG anti-virus system (<A 
href="http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: 6.0.788 /
Virus Database: 533 - Release Date: 11/1/2004</DIV></FONT></BODY></HTML>

------=_NextPart_000_0006_01C4C417.A1C65C80--

new topic     » topic index » view message » categorize

2. Re: Calculating points in a circle

Given just the radius and center point is kind-a rough, but trig should
be able to solve it for you, if you know at least one other variable. If
you are trying to solve from the horizontal plane maybe?

jami

new topic     » goto parent     » topic index » view message » categorize

3. Re: Calculating points in a circle

Try this:
a is angle
r is radius(or was I correct the last time saying diameter...?)
x and y are the coordinates

Resize the window to see the circle.

include Win32Lib.ew
without warning

--------------------------------------------------------------------------------
--  Window w
constant w = createEx( Window, "Window1", 0, Default, Default, 400, 300, 0, 0 )

procedure w_onResize (integer self, integer event, sequence params)--params is (
int style, int cx, int cy )
int x,y,r
repaintWindow(w)
r=floor(params[2]/2)

for a=-PI to PI by 1/(r*PI) do
	x=floor(sin(a)*r)+r
	y=floor(cos(a)*r)+r
	setPixel(w,x,y,0)
	--?{x,y}
end for
end procedure
setHandler( w, w32HResize, routine_id("w_onResize"))


WinMain( w,Normal )


new topic     » goto parent     » topic index » view message » categorize

4. Re: Calculating points in a circle

This will give you a simple circle.
angle is from -PI to PI.
Calculating how to increment angle
still needs to be figured out.

x=sin(angle)*diameter
y=cos(angle)*diameter

new topic     » goto parent     » topic index » view message » categorize

5. Re: Calculating points in a circle

My second reply(it displayed before this one) is better.

CoJaBo wrote:
> 
> This will give you a simple circle.
> angle is from -PI to PI.
> Calculating how to increment angle
> still needs to be figured out.
> 
> x=sin(angle)*diameter
> y=cos(angle)*diameter
> 
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu