1. Senior Member
Join Date
Jan 2013
Posts
124
Rep Power
0

## circular 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?

2. ## Re: 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

3. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
15

## Re: 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

4. Senior Member
Join Date
Jan 2013
Posts
124
Rep Power
0

## Re: 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.

5. ## Re: 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

6. Senior Member
Join Date
Jan 2013
Posts
124
Rep Power
0

## Re: 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.

7. ## Re: circular movement

Originally Posted by vastrolorde
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.
You hve to describe that 'something else' in much greater detail ...

kind regards,

Jos

8. Senior Member
Join Date
Jan 2013
Posts
124
Rep Power
0

## Re: 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.

9. ## Re: 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

10. Senior Member
Join Date
Jan 2013
Posts
124
Rep Power
0

## Re: 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.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•