Is there a efficient way to control ciruclar movement using acceleration instead of calculating every coordinate manually? And the radius fluctuation stays under 2 pixels, if possible?

Printable View

- 08-25-2013, 12:08 PMvastrolordecircular movement
Is there a efficient way to control ciruclar movement using acceleration instead of calculating every coordinate manually? And the radius fluctuation stays under 2 pixels, if possible?

- 08-25-2013, 01:13 PMJosAHRe: circular movement
Google for "Bresenham circle"; it is an extremely efficient circle drawing algoritm that takes n steps where n is the number of pixels on the circle.

kind regards,

Jos - 08-25-2013, 07:31 PMjim829Re: circular movement
One of the rewards of participating in a forum. I never heard of the "Bresenham circle." Now I have something else to read about.

Regards,

Jim - 08-25-2013, 09:10 PMvastrolordeRe: circular movement
Yes, it seems quite interesting. But does it work with 500 point in different radiuses atthe same time ? The end product should be: point spawns somewhere on the screen. point starts moving towards the given mid point. after reaching certain distance from the midpoint, the point smoothly converts its linear movement towards the middle into circular movement around the midpoint.

And this tyoe of movement should work with eatch of the 500 point and all the point orbit around the midpoint with different radiuses. - 08-25-2013, 09:53 PMJosAHRe: circular movement
Congratuations, you have just changed the problem requirements; what you describe now isn't a circular movement, it's a spiral; maybe google can be of further help.

kind regards,

Jos - 08-26-2013, 03:27 PMvastrolordeRe: circular movement
It is not a spiral, it will never reach the midpoint it just keeps its distance from the midpoint. I can use Bresenham circle in hte secondpart of the movement, but the first part needs to be something else. I would show you the picture of whati mean, but unfortunatle the upload image function in this forum doesent work for me.

- 08-26-2013, 03:53 PMJosAHRe: circular movement
- 08-26-2013, 05:13 PMvastrolordeRe: circular movement
Ok ill try.

Step 1: Particle is generated

Step 2: Particle starts moving straight towards the middle point

Step 3: After reaching Radius + X pixels away from the midpoint particle trajectory starts to curve

Step 4: Curvature ends when particle reaches Radius pixels from midpoint

Step 5: From thispoint onward i can use Bresenham circle

The problematic spot is Step 3 and Step 4. I want the particle to go smoothli into the orbit. Well the number 6 and number 9 somewhat reseble the trajectory im wanting. - 08-26-2013, 06:04 PMJosAHRe: circular movement
In other words: let the centre of the circle be at (0,0) and the particle is moving downwards; it is moving in the same direction as the radius 'r' from (0,r) to (0,0); at a location (0, r+x) it has to change its direction (suppose it starts moving to the right and downwards) such that when the distance of the particle to the centre equals r, it has to have a direction perpendicular to the radius r at a point (x,y); so its direction should be -x/y (or x/-y) where x^2+y^2 == r^2; hm, my guess would be a discretization of a differential equation ...

I'll keep it in the back of my head ...

kind regards,

Jos - 08-28-2013, 07:46 PMvastrolordeRe: circular movement
discretization of a differential equation i understood most of what you said but when you said "discretization of a differential equation" you lost me.