From a Cell to a Location on a Curve
A trajectory represents a path through a space in which each cell is represented by a point. To assign a scalar location along that path, first find the point on the curve closest to the cell. The parameter value at that point identifies a location in a chosen parameterization; converting it to arc length gives a distance measured along the curve. The two coordinates are related but are not automatically the same.
The geometric derivation is simple to state, but its conditions matter. A point satisfying the derivative equation for squared distance is only a stationary candidate. It need not be the closest point, and there may be more than one equally close point. A reliable projection therefore involves both a local geometric condition and a global comparison of distances.
For the derivative-based condition below, assume that \(\gamma\) is twice continuously differentiable near an interior candidate \(t^*\), and that it is regular there: \(\gamma'(t^*)\ne 0\). A minimum exists, for example, if \(I\) is compact and \(\gamma\) is continuous. If the parameter set is open or unbounded, existence must instead be checked; a minimizing sequence need not attain its limiting distance at any allowed parameter.
Deriving the Projection Condition
Minimizing the distance \(\|x-\gamma(t)\|\) is equivalent to minimizing its square \(D(t)\), since squaring preserves the order of nonnegative distances. Differentiating the squared distance gives
At an interior differentiable minimum, the first derivative is zero. Thus the residual from the curve point to the cell is perpendicular to the tangent vector:
This condition says that, at a smooth interior nearest point, moving a small amount forward or backward along the curve cannot reduce the squared distance to first order. It does not alone establish that a candidate is a minimum. The second derivative is
If \(D''(t^*)>0\), the stationary candidate is a strict local minimum. If \(D''(t^*)<0\), it is a local maximum, not a projection. If \(D''(t^*)=0\), this test is inconclusive. Even a strict local minimum may not be the global minimum: other parts of the curve can lie closer to \(x\).
The orthogonality condition follows directly from first-order change in distance. For a small parameter change \(h\), differentiability gives \(\gamma(t+h)=\gamma(t)+h\gamma'(t)+o(h)\). Hence
At an interior minimum, the first-order term cannot decrease \(D\) for both positive and negative \(h\). Its coefficient must therefore be zero, which yields the orthogonality equation. This argument explains why the condition is necessary for an interior minimum; it does not prove that every solution is a minimum or that the minimum is unique.
Worked Geometric Examples
Worked Example: Projection onto a Straight Trajectory
Consider the line \(\gamma(t)=(t,t)\), with \(t\in\mathbb R\), and a hypothetical cell at \(x=(3,1)\). Find the nearest point and its scalar coordinate.
The squared distance is $$ D(t)=(3-t)^2+(1-t)^2. $$ Differentiating gives \(D'(t)=2(t-3)+2(t-1)=4t-8\). Setting this equal to zero gives \(t^*=2\). Since \(D''(t)=4>0\), this is a strict minimum; the quadratic also grows without bound as \(|t|\) grows, so this is the global minimum.
The projected point is \(\gamma(2)=(2,2)\), and the residual is \(x-\gamma(2)=(1,-1)\). The tangent is \(\gamma'(2)=(1,1)\), and their dot product is \(1-1=0\), as required. The perpendicular distance is \(\sqrt{D(2)}=\sqrt{2}\) coordinate units.
If the curve coordinate is measured as arc length from \(t=0\), then \(s(t)=\int_0^t\|\gamma'(u)\|\,du=\sqrt{2}t\). Thus the projected arc-length coordinate is \(s(2)=2\sqrt{2}\) coordinate units. The parameter \(t^*=2\) and arc length \(2\sqrt{2}\) describe the same projected location using different scales.
Worked Example: Projection onto a Curved Trajectory
Let the hypothetical trajectory be the parabola \(\gamma(t)=(t,t^2)\), \(t\in\mathbb R\), and let a cell be at \(x=(1,0)\). Find its nearest curve location by minimizing squared distance.
Here $$ D(t)=(1-t)^2+t^4,\qquad D'(t)=2(t-1)+4t^3,\qquad D''(t)=2+12t^2. $$ The stationary equation is \(2t^3+t-1=0\). It has one real root: its left-hand side is strictly increasing because its derivative \(6t^2+1\) is positive, and it changes sign between \(t=0\) and \(t=1\). Numerically, the root is \(t^*\approx0.5897545\). Since \(D''(t)>0\) for every \(t\), \(D\) is strictly convex, so this stationary point is the unique global minimum.
Substituting the approximate root gives \(\gamma(t^*)\approx(0.5897545,0.3478104)\). The squared distance is approximately $$ D(t^*)\approx(1-0.5897545)^2+(0-0.3478104)^2 \approx0.1683014+0.1209721 \approx0.2892734. $$ The perpendicular distance is therefore \(\sqrt{0.2892734}\approx0.53784\) coordinate units. The residual is orthogonal to the tangent up to rounding because \(2(t^*)^3+t^*-1\approx0\).
The parameter coordinate is \(t^*\approx0.5897545\). If arc length is measured from the point \(\gamma(0)\), the arc-length coordinate is $$ s(t^*)=\int_0^{t^*}\sqrt{1+4u^2}\,du. $$ This integral, rather than \(t^*\) itself, measures distance along the curved trajectory. The parameter is useful for locating the point in this chosen parameterization; arc length is the corresponding geometric distance from the chosen starting point.
Worked Example: A Stationary Point Need Not Be the Projection
Consider the circle \(\gamma(\theta)=(2\cos\theta,2\sin\theta)\) and a hypothetical cell \(x=(3,4)\). The parameter is an angle, so values differing by \(2\pi\) describe the same point. Determine the nearest point and explain why solving the stationary equation alone is insufficient.
The cell has distance \(5\) from the circle's center. The nearest point on the radius-2 circle lies in the same radial direction, at \(\gamma(\theta^*)=(2\cdot3/5,2\cdot4/5)=(1.2,1.6)\), corresponding to \(\theta^*=\arctan(4/3)\). Its distance from the cell is \(\sqrt{(3-1.2)^2+(4-1.6)^2}=\sqrt{1.8^2+2.4^2}=3\).
The opposite point \((-1.2,-1.6)\) is also stationary: its residual is radial and therefore perpendicular to the circle's tangent. But its distance from \(x\) is \(7\), not \(3\). Thus both points satisfy the first-order condition, while only the first is the global nearest point. With arc length measured from \((2,0)\) in the direction of increasing angle, the projected coordinate is \(s^*=2\arctan(4/3)\), in the circle's coordinate units.
Turning the Projection into a Curve Coordinate
A scalar coordinate along the curve depends on how the curve is parameterized. If a cell projects to \(\gamma(t^*)\), then \(t^*\) is a valid scalar coordinate for that parameterization, but reparameterizing the same geometric curve can change its numerical value. Arc length provides a geometric alternative. Given a reference parameter \(t_0\) and a chosen direction of travel, define
The projected arc-length coordinate is \(s(t^*)\), with sign determined by the chosen direction and reference point. If \(\gamma\) is regular, this coordinate increases strictly with \(t\) when the parameter direction is followed. Reversing the direction changes the orientation, and changing the reference point shifts the coordinate. These choices affect reported scalar values but not the projected point or its distance from the cell.
For cells in a single-cell embedding, \(x\) and \(\gamma(t)\) must be expressed in the same coordinate space, and the distance metric determines what “nearest” means. A Euclidean projection in an embedding is a geometric assignment in that embedding; it does not by itself establish a biological time or a causal ordering. The scalar coordinate is relative to the chosen curve, metric, reference point, and orientation.
Diagnostics, Alternatives, and Limitations
A projection deserves closer inspection when the numerical solution appears to disagree with the geometry. Useful checks include evaluating the residual norm, checking the tangent-residual dot product at an interior solution, and comparing distances across competing candidates. For a bounded curve segment, include endpoints in that comparison: an endpoint minimum need not satisfy the interior orthogonality condition. For a numerical search, evaluate whether the reported point is stable to finer resolution or different starting values; a search that finds only one local minimum can miss a closer one elsewhere.
The principal alternatives answer related but different questions. Assigning a cell to its nearest sampled curve point is simple, but its accuracy depends on how densely the curve was sampled. Projecting onto the tangent line at a nearby location gives a local linear approximation, not the nearest point on the full curved path. Directly minimizing distance to the smooth curve respects its curvature, but can require numerical optimization and can be sensitive to the parameterization and distance metric. None of these choices resolves ambiguity when two distinct curve locations are equally close.
- Nonunique projection: At a self-intersection or near two close segments, a cell may have multiple equally close or nearly equally close locations. A single scalar coordinate can then hide genuine geometric ambiguity.
- Endpoint effects: If the allowed curve is a segment, the minimum may occur at an endpoint. The tangent-orthogonality equation applies only to interior minima; endpoints must be checked separately.
- Poor local optimization: A stationary solution may be a maximum or a local minimum that is farther away than another candidate. Check curvature information where useful and compare global candidate distances.
- Metric dependence: Rescaling or transforming embedding coordinates changes Euclidean distances and can change the nearest point. Interpret the projection relative to the coordinate system and metric actually used.
Common mistake: “The residual is perpendicular to the tangent, so this point must be the nearest projection.” Perpendicularity is necessary for an interior nearest point, but it is also satisfied at other stationary points. The correction is to use the condition to find candidates, then check local behavior and compare their distances, including endpoint distances where relevant.
These qualifications matter because a scalar curve coordinate can look precise even when the geometry does not support a unique assignment. Reporting or using such a coordinate is most defensible when the projection is stable, clearly nearer to one curve location than to alternatives, and interpreted in the context of the chosen embedding and curve.
Check Your Understanding
Work through these questions, then compare your reasoning with the solutions.
- For an interior projection onto a differentiable curve, what vector must be perpendicular to the curve tangent?
- Why does a solution to the first-derivative equation not prove that it is the global nearest point?
- A curve is parameterized as \(\gamma(t)=(3t,4t)\). What is the arc length from \(t=0\) to \(t=2\), and why is it not generally equal to the parameter value?
- On a bounded curve segment, what additional candidates must be checked when finding a global projection?
- Give one reason that a cell may not have a unique scalar curve coordinate.
Solutions. (1) The residual \(x-\gamma(t^*)\) must be perpendicular to the tangent \(\gamma'(t^*)\), so their dot product is zero. (2) The equation identifies stationary candidates, which can be maxima or non-global local minima; compare candidate distances and any endpoint distances. (3) Since \(\|\gamma'(t)\|=\|(3,4)\|=5\), the arc length is \(\int_0^2 5\,dt=10\) coordinate units. The parameter measures the scale chosen for this parameterization, whereas arc length measures distance along the curve. (4) Check both endpoints as well as interior stationary candidates. (5) A self-intersection or two equally close curve segments can yield distinct nearest points, so the projected location—and thus its scalar coordinate—may be ambiguous.