Computer Science Canada help me please..about to make a point move randomly... |
Author: | cliff.skc [ Fri Apr 01, 2005 7:28 pm ] |
Post subject: | help me please..about to make a point move randomly... |
does anyone can tell me how to make a point in the screen that can move randomly in a circle!? thanks so much!! |
Author: | Cervantes [ Fri Apr 01, 2005 7:38 pm ] |
Post subject: | |
If a point is moving randomly, it's probably not moving in a circle. If it's moving in a circle, it's not moving randomly. Please elaborate. |
Author: | person [ Fri Apr 01, 2005 7:44 pm ] |
Post subject: | |
i think he means that there is a point moving randomly but the randomly moving spots are inside a circle |
Author: | cliff.skc [ Fri Apr 01, 2005 7:48 pm ] |
Post subject: | |
haha sorry guys ...my english sucks eh...haha... i mean there is a circle.. and now i wanna put a point in this circle... and it can move randomly in this circle... hope you guys understand to it...^^""" |
Author: | Cervantes [ Fri Apr 01, 2005 8:05 pm ] |
Post subject: | |
You can use Math.Distance* to determine whether the point is within the circle's radius. But, I'm still not 100% clear. Do you want the dot to be randomly "teleporting" within the circle, or do you want it to be moving, pixel by pixel, but remaining within the circle? *Math.Distance is a function of Turing 4.0.5. If you don't have this, you can write your own distance function using the distance formula. |
Author: | person [ Fri Apr 01, 2005 8:17 pm ] | ||
Post subject: | |||
btw: this is using whatdotcolour |
Author: | cliff.skc [ Fri Apr 01, 2005 8:23 pm ] |
Post subject: | |
ahh..sorry again of my stupidness eh...-n-... hmm... i want to make the point keep moving around in a circle... that means theres only 1 point...and it keeps moving in the circle... |
Author: | RaPsCaLLioN [ Fri Apr 01, 2005 8:25 pm ] | ||
Post subject: | |||
Math.Distance is usually better than colour detection. Especially if multiple colours will be displayed withing this circle. I believe you mean something like this...
|
Author: | zylum [ Fri Apr 01, 2005 8:25 pm ] | ||||
Post subject: | |||||
jump randomly?
or maybe brownian motion?
|
Author: | RaPsCaLLioN [ Fri Apr 01, 2005 8:32 pm ] |
Post subject: | |
Nice code zylum! |
Author: | cliff.skc [ Fri Apr 01, 2005 8:34 pm ] |
Post subject: | |
yeah that's right!! i need the third one...!! thanks a lot!! but then i just a gr.10 student... and those stuffs i haven't learned it yet... is there any simply codes that can show the similar image!? |
Author: | person [ Fri Apr 01, 2005 8:43 pm ] | ||
Post subject: | |||
i think zylum's code is the best for the computer to read, and Raps' code is also good (using Cervantes idea)... basicly they have the best code if u can understand them for ur question, my code would probably be the easiest and the most basic, but if u can understand zylum's use his just in case that u r considering to use mine, all u need is to make a small change and ull be set btw: i almost forgot
|
Author: | cliff.skc [ Fri Apr 01, 2005 8:54 pm ] |
Post subject: | |
alright...thanks you guys very very much!! |
Author: | cliff.skc [ Tue Apr 05, 2005 9:26 am ] |
Post subject: | |
ok, let me rephrase my question....how can i make a circle rotate continuously on a single point?? |
Author: | Cervantes [ Tue Apr 05, 2005 10:17 am ] | ||
Post subject: | |||
Well, if a circle is rotating around a point, you won't see any change. What I think you mean is you want to draw a dot that travels around the circumfrence of the circle. For that, we use some trig.
r is the radius, a is the angle. the + 100's move the dot such that it travels around a circle whose centre is (100, 100). |
Author: | Drakain Zeil [ Tue Apr 05, 2005 2:29 pm ] |
Post subject: | |
1=x**2+y**2 ^Circle. |