Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2006-08-10 03:04:00

safra
Member
Registered: 2005-12-03
Posts: 41

Move around circle

Hi,

I have been looking for circle formula's but cannot find what I need. What I need is a formula that returns the x,y position of a point on a circle with a given center point and diameter or radius based on a start point on the circle and a number of steps. For example if steps is set at 10. And you check the position at step 5, it should return the point opposite of the starting point. Someone knows if this can be put in a formula?

Thanks,
raoul

Offline

#2 2006-08-10 03:15:40

ben
Member
Registered: 2006-07-12
Posts: 106

Re: Move around circle

Look at this excellent intro for starters: http://www.mathsisfun.com/forum/viewtopic.php?id=4041

Offline

#3 2006-08-10 05:00:34

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: Move around circle

I understand everything up to the "steps" part.  What do you mean by a step?


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

#4 2006-08-10 06:06:53

safra
Member
Registered: 2005-12-03
Posts: 41

Re: Move around circle

Thanks Ben, I didn't think of using sin and cos. But I think this is what I need although I would like to stay away from it or use a look up table (for programming speed).

Ricky, perhaps you now understand what I mean with steps? What I like to do is move a camera around a point in a circle in x steps. So at each given step I need to find the new camera position.

Offline

#5 2006-08-10 07:43:11

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: Move around circle

Ah, so a step is a fraction of an angle.  Got it.

What language are you doing it in?  Most current languages take advantage of trig functions which are actually on the hardware level, and so calling the trig functions provided by the programming library (provided there is one), can actually be faster than a lookup table.  Sin and cos can actually be extremely fast, again, depending on what language/machine.

So do you need more help with a formula?


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

#6 2006-08-10 08:11:30

safra
Member
Registered: 2005-12-03
Posts: 41

Re: Move around circle

I am using pascal (delphi). I read many things about sin and cos. Some saying it is expensive while others did tests and found that it was indeed faster or at least something similar as using a lookup table. I think I should test this myself as I am already using quite a lot of sin and cos in my program.

Well if indeed this is what I should use then I should be able to get it working, thanks again!

Offline

#7 2006-08-10 08:30:28

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: Move around circle

If you need help writing a hash table for testing, let me know.

When I did it in C++ (MS compiler), it was much faster using the library functions.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

#8 2006-08-11 21:19:18

safra
Member
Registered: 2005-12-03
Posts: 41

Re: Move around circle

Thanks for offering your help! I did a search and found some good information that should get me going with this. If not then I will let you know.

Offline

#9 2008-07-22 16:53:56

blessy
Member
Registered: 2008-07-22
Posts: 1

Re: Move around circle

I am a new visitor of this forum. It is very nice site. Wit the help of this site we should get any answer of mathematically related question or game. So this is very useful to everyone. Mathematics has its functions for the manipulation of anything such as  find area of a circle, volume of a cube etc. These functions are  formed a group named as math functions. They are very useful in computer languages such as c, c++ etc.

=========================================

Bless

Offline

Board footer

Powered by FluxBB