- Home /

# Find distance around a circle, from center point and another point

I am having trouble creating a circle in 3d space, and fining a point along it. So if I have a circle with center point C, and a point on the circle R, would it be possible to find a point a specific distance along the circle from R? I don't necessarily need the code to do it, but just assistance on the math.

**Answer** by robertbu
·
Nov 10, 2013 at 06:26 PM

There are an infinite number of circles that have a center and a point in common, so you need to specify one specific circle. The code below uses the axis (normal) to the circle. The polarity of the axis will determine which direction to move along the circle. It solves your problem by creating a vector between the center and the point. It then calculates the angle by using the fraction of the circumference the distance travels. An AngleAxis() rotation generates the point. The code is untested:

```
function FindPoint(center : Vector3, r : Vector3, dist : float, axis : Vector3) : Vector3 {
var v3 = r - center;
var circumference = 2.0 * Mathf.PI * v3.magnitude;
var angle = dist / circumference * 360.0;
v3 = Quaternion.AngleAxis(angle, axis) * v3;
return v3 + center;
}
```

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

Maths: Given a point on a circle and a fixed length line. Find the next closest point on the circle. 2 Answers

Programmatically specifying a random point in an arc in front of the player 1 Answer

Position between objects, vector math. 1 Answer

Circular motion via the mathematical circle equation? 4 Answers

GUI Coordinate System 0 Answers