Click to See Complete Forum and Search --> : How do I find points on a circle?
celsius
Dec 23rd, 1999, 09:07 AM
I am having trouble with this one - I need to calculate the points of a circle. For example: If you wanted to make a clock (the kind with hands) and have a line spin around like the hands, I need to calculate the outer points to do that. Can anyone help? thanks.
http://www.angelfire.com/or/cam13
John
Dec 23rd, 1999, 07:30 PM
For a clock in particular, have a look at:
http://visualbasic.about.com/compute/visualbasic/library/weekly/aa112399a.htm
Some of the concepts can be used to determine the points on a circle.
------------------
John Percival
Editor, VB-World.net
john@vb-world.net
celsius
Dec 24th, 1999, 12:51 AM
Thanks for the help, but I forgot to add one thing; I am making a look-alike "radar" and it beeps when the line passes over the dot. Any suggestions on how to detect when it passes? Thanks
Your point (on a circle) should form some angle with the axis point of your radar sweep and the horizontal line going through (say 9 o'clock to the axis point to 3 o'clock--from left to right). If you decide to call 12 o'clock to be NORTH equal to 0 degrees, then 1 o'clock is 30 degrees, 2 o'clock is 60 degrees etc, until you go back to 12 equals 360 degrees which is the same as 0 degrees.
You calculate the angle of the (point on the circle) using this reference; then as the radar sweeps around, you can say
If RadarSweepAngle = PointAngle Then Beep
I trust that you know about Polar and Cartesian Coordinates, so the rest is trivial.
Merry Christmas
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.