Ma · Mathematics

How to Parametrize a Circle in 3D from Its Center and Two Points

Published By the 9to5Science editorial team

At a glance

  1. 1. Check the distances

    Confirm both points are the same positive distance from the center.

  2. 2. Build a basis

    Normalize the first radius vector, then remove its component from the second and normalize the remainder.

  3. 3. Write the circle

    Combine the two perpendicular unit vectors with cosine and sine, and add the center.

  4. 4. Find the second angle

    Use atan2 on the second point’s coordinates in the basis to find its parameter value.

A circle in three dimensions lies in a plane, so its parametrization needs two perpendicular directions in that plane. The center and two points on the circle usually determine those directions and the radius.

The method below constructs an orthonormal basis from the two center-to-point vectors, then uses sine and cosine to trace the circle. It also shows how to find the parameter value corresponding to each given point.

Check that the data define a circle

Write the center as CC and the two points as PP and QQ. Their radius vectors are

u=P−C,v=Q−C.\mathbf{u}=P-C, \qquad \mathbf{v}=Q-C.

For both points to lie on the same circle centered at CC, they must satisfy

∥u∥=∥v∥=r>0.\|\mathbf{u}\|=\|\mathbf{v}\|=r>0.

If the distances differ, no circle with that center passes through both points. If the radius is positive and the two radius vectors are not parallel, they determine a unique plane through the center. If they are parallel, the circle’s plane is not uniquely determined; this includes the case where the two points are antipodal.

Construct the circle’s plane basis

Use the first radius vector as the first direction:

e1=ur.\mathbf{e}_1=\frac{\mathbf{u}}{r}.

Remove from the second radius vector its component parallel to e1\mathbf{e}_1:

w=v−(v⋅e1)e1.\mathbf{w}=\mathbf{v}-(\mathbf{v}\cdot\mathbf{e}_1)\mathbf{e}_1.

If w≠0\mathbf{w}\ne\mathbf{0}, normalize it to obtain a perpendicular unit vector:

e2=w∥w∥.\mathbf{e}_2=\frac{\mathbf{w}}{\|\mathbf{w}\|}.

The vectors e1\mathbf{e}_1 and e2\mathbf{e}_2 are perpendicular, lie in the circle’s plane, and both have length one. The circle is therefore

x(t)=C+r(e1cos⁡t+e2sin⁡t),t∈R.\boxed{\mathbf{x}(t)=C+r\bigl(\mathbf{e}_1\cos t+\mathbf{e}_2\sin t\bigr)}, \qquad t\in\mathbb{R}.

At t=0t=0, this gives C+re1=PC+r\mathbf{e}_1=P. As tt varies, the cosine and sine coefficients trace the circle in the plane spanned by the two basis vectors. Restricting tt to [0,2π)[0,2\pi) traces it once; allowing all real tt repeats the same circle periodically.

Find the parameter for the second point

The formula starts at PP, but QQ generally occurs at a different parameter value. Express its radius vector in the constructed basis. Its angle is

θ=atan2⁡(v⋅e2, v⋅e1).\theta=\operatorname{atan2}(\mathbf{v}\cdot\mathbf{e}_2,\,\mathbf{v}\cdot\mathbf{e}_1).

Here atan2⁡(y,x)\operatorname{atan2}(y,x) returns the angle whose sine and cosine have the signs and ratio specified by yy and xx. Since ∥v∥=r\|\mathbf{v}\|=r, the basis coordinates are rcos⁡θr\cos\theta and rsin⁡θr\sin\theta, so x(θ)=Q\mathbf{x}(\theta)=Q. The angle is in radians, and its value can differ by a multiple of 2π2\pi without changing the point.

Worked example

Take

C=(1,1,0),P=(3,1,0),Q=(2,1+3,0).C=(1,1,0),\qquad P=(3,1,0),\qquad Q=(2,1+\sqrt{3},0).

The radius vectors are u=(2,0,0)\mathbf{u}=(2,0,0) and v=(1,3,0)\mathbf{v}=(1,\sqrt{3},0). Both have length 22, so r=2r=2. The first unit vector is

e1=(1,0,0).\mathbf{e}_1=(1,0,0).

The component of v\mathbf{v} perpendicular to e1\mathbf{e}_1 is (0,3,0)(0,\sqrt{3},0), which gives e2=(0,1,0)\mathbf{e}_2=(0,1,0). Thus

x(t)=(1+2cos⁡t,  1+2sin⁡t,  0).\mathbf{x}(t)=(1+2\cos t,\;1+2\sin t,\;0).

For QQ, the basis coordinates are v⋅e1=1\mathbf{v}\cdot\mathbf{e}_1=1 and v⋅e2=3\mathbf{v}\cdot\mathbf{e}_2=\sqrt{3}. Therefore θ=atan2⁡(3,1)=π/3\theta=\operatorname{atan2}(\sqrt{3},1)=\pi/3. Substituting gives

x(π/3)=(2,1+3,0)=Q.\mathbf{x}(\pi/3)=(2,1+\sqrt{3},0)=Q.

Common mistakes

  • Using the points instead of radius vectors: Subtract the center first. The directions are P−CP-C and Q−CQ-C, not PP and QQ themselves.
  • Using the second radius vector directly as the second basis direction: It usually is not perpendicular to the first. Remove its parallel component before normalizing.
  • Forgetting to check the radii: The construction assumes both points are exactly distance rr from the center.
  • Treating the plane as unique for antipodal points: If Q−C=−(P−C)Q-C=-(P-C), the radius vectors specify only a line. Any plane through that line gives a possible circle, so more information is needed to choose one.
  • Using three unrelated coordinate sinusoids: The cosine and sine must multiply two perpendicular directions in the circle’s plane; this keeps the curve planar and at constant distance rr from the center.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.