Win a copy of Functional Reactive Programming this week in the Other Languages forum!

# Fluid Motion Moving Circles Smooth -solved-

Mark Quin
Greenhorn
Posts: 15
I have a circle that follows another circle controlled by the user. But, the following circle works but can only move in angles. Is there any examples out there or some tips you can give me to have circles move fluidly.

x,y is the user controlled circle.
xpos,ypos is the following circle.

Here is my class:

[ October 25, 2007: Message edited by: Mark Quin ]
[ October 25, 2007: Message edited by: Mark Quin ]

Ilja Preuss
author
Sheriff
Posts: 14112
So you want that circle to move at a fixed speed in the direction of the other circle?

I imagine there is a simple solution using Pythagoras' theorem.

Mark Quin
Greenhorn
Posts: 15
So, a^2+b^2=c^2 some how can make fluid movement? Unlike of the current 45 deg angles that the ball loves to move in. Interesting, I wonder if I can find anything about how to implement it.

Are there any simple examples or links to them?

[ October 25, 2007: Message edited by: Mark Quin ]

solved, Just had to change some thing and make them doubles. =)
[ October 25, 2007: Message edited by: Mark Quin ]