# Find circle given a point on a sphere and a tangent vector

I need to formulate an equation for a circle that exists on a given sphere, given a point on the sphere and a directional tangent vector.

I am trying to write a graphical program that has some characters moving around a sphere. I need the equation so I can update each character's position. The characters have an orientations and a starting point. I just need to move them over time around a sphere.

-
Are you looking for a great circle (which would be unique) or any old circle on the sphere through the given point in the given direction? – Andreas Blass Nov 21 '12 at 20:20
wouldn't a point on a sphere with a tangent vector at that point give a great circle? Doesn't a point and a vector describe a plane, then a plane and sphere intersection describe a circle? I just don't know how to come up with those equations. – lkoester Nov 21 '12 at 20:58

It's true that there are infinitely many circles on a sphere through a given point with a given initial velocity. (Just intersect the sphere with any affine plane that contains the initial point and to which the initial velocity vector is tangent.) But if you want a great circle, then there's only one, namely the intersection of the sphere with the linear subspace of $\mathbb R^3$ spanned by the initial point and the initial velocity, regarded as vectors in $\mathbb R^3$. It's given by a simple formula.
Suppose $p$ is a point on the sphere and $v$ is a vector tangent to the sphere at $p$. (Here I'm thinking of both $p$ and $v$ as elements of $\mathbb R^3$.) Let $a = \|v\|/\|p\|$. The great circle with initial point $p$ and initial velocity $v$ is parametrized by $$c(t) = (\cos at)p + \frac{1}{a}(\sin at) v.$$ If the sphere has unit radius and $v$ is a unit vector, then this simplifies to $$c(t) = (\cos t)p + (\sin t)v.$$
May I suggest adding that this circle is the intersection of the sphere and the subspace of $\mathbb{R}^3$ spanned by $p$ and $v$? – Neal Nov 22 '12 at 23:38
If v is a unit vector in the direction you want the character to go, then my first formula is a unit-speed curve, so it traverses a distance t in time t. If the vector $v_0$ you start with is not a unit vector, you can just divide it by its norm and use $v = v/\|v_0\|$ in the formula. – Jack Lee Nov 26 '12 at 16:01