# Thread: Hard program? Need Help.. who can?

1. ## Hard program? Need Help.. who can?

hi ,
im asked to do this program but I dont know how to keep the track of the movement of the ball(point) inside the circle ,
the circle environment is given as n
the details is here with this file .

2. Code:
```struct coordinate
{
int xcoord, ycoord;
};```
That'll suffice for tracking location. You could do it a few ways. Track coordinate on a grid based with a 0,0 as the center of the circle, using +/-X and +/-Y for the distance and direction from center. Or you could map the circle to a grid, so some place outside the circle to the upper left would be 0,0 and down to the right of the circle would be N,N.

Quzah.

3. thanx Quzah for your reply..
please see these details in this attached file .

4. guys ,,
I didnt ask you to give me the solution,,
I just want to ask about the general idea .. how to
move this point with a specified direction from the user as as input..
so the inputs are :
point position and its direction
???

5. So what's your problem? Do you not know how to get input? Do you not know how to plot your circle to a grid? Do you not know how to plot a line for movement? What exactly?

Quzah.

6. thank you quzah very much for your help
my problem now is how to implement the speed of the point?
in the question above , every point has a speed and weight ..
how to do the speed thing?

7. Here's one way
Code:
```struct particle
{
int xcoord, ycoord;
int dx, int dy;
};```
Each time around the loop, its
pt.xcoord += dx;

Every time the particle bounces, change dx,dy

Popular pages Recent additions