POV-Ray : Newsgroups : povray.general : Closest points on two circles : Re: Closest points on two circles Server Time
4 Aug 2024 22:16:15 EDT (-0400)
  Re: Closest points on two circles  
From: Retsam
Date: 29 Mar 2003 02:35:06
Message: <web.3e8548abe86bfd1834dff4bb0@news.povray.org>
Edward Coffey wrote:
>Thanks for the suggestions everyone, looks like I'll just try to
>approximate it.
>

You know, this has been bugging me, because it just seems like there's got
to be a way to do it with straight vector math, without resorting to
sin/cos parameterizations and taking partial derivatives (with respect
to each parameter) to find local minima.

The best I've been able to come up with so far is this.

Take two circles, centers at C and D, with respective normals M and N.  Pick
two points, one on each circle, P on circle C, and Q on circle D.

In order for point P to be the closest point on circle C to point Q, the
plane defined by triangle CPQ must contain the normal vector M.  Put
another way, the triple product (is that what it's called?) of (CPxPQ).M
must equal zero.  That is, CP cross PQ is perpendicular to the plan CPQ,
and that vector dotted with the normal M (which is in CPQ) should be zero.

Ditto for (DQxQP).N=0

The only problem is how to find points P and Q.  So far I am still stuck
with parameterizing the circles.  I want something prettier involving the
center, normal, and radius, and maybe some cross products or something...
But I'm still drawing a blank.

But the advantage is, to find an exact solution, you don't need to take the
partial derivatives of the distance function between points P and Q
(i.e. take the partials of an ugly function involving sines, cosines,
and square roots).

You don't need derivatives, you just need to find the matching zeroes of two
vector problems (which reduce to scalars because of the nature of the
triple product).

So I know it's not an equation, but maybe for those still interested in a
better method than trial and error, it's a step in the right direction.
This will continue to bug me for days, so I might be back with more later.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.