# how drive an object in a full circle?

This topic is 3662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, 3D Math Noob here. I have an object that starts at, say, x,y,z. I would like it to go to point x2,y2,z2 ... xN,yN,zN, until it has done a full revolution. What is the way to think about this problem? THANKS!

##### Share on other sites
To rotate an object in a circle in 3D space, you need an axis to rotate it around, and a radius.

The simplest case is when your circle is in the x,z plane (i.e. flat on the ground), and you want to rotate around the y-axis, centred on the origin. In this case you just need basic trigonometry (in particular the parametric equation of a circle), and you will end up with something like this:
def position_on_circle(time):		radius = 1.0		x = cos(time) * radius	y = 0	z = sin(time) * radius		return x, y, z

[Edited by - swiftcoder on December 4, 2008 9:16:39 AM]

##### Share on other sites
how could i generate an even distribution of x,z points?

##### Share on other sites
Quote:
 Original post by cellishow could i generate an even distribution of x,z points?
An even distribution around that circle on the x,z plane? By feeding uniform values into that function:
points = []for f in range(0, 2*pi, 0.1):	points.append( position_on_circle(f) )

Keep in mind that sin and cos take arguments in radians, so one entire circle is 2*pi radians.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633701
• Total Posts
3013441
×