2

Let $P,Q,R$ be ordered sets of $n$ points in $[0,1]$ e.g. $0 \leq p_1 < p_2 < \ldots < p_{n-1} < p_n \leq 1$. Let $\mathbf{u},\mathbf{v},\mathbf{w}$ be pairwise non-colinear plane vectors and $\mathbf{u}^\perp,\mathbf{v}^\perp,\mathbf{w}^\perp$ their respective perpendicular vectors.

Consider then the three familes of lines

$$L_i:p_i\mathbf{u} + \lambda\mathbf{u}^\perp \qquad M_j:q_j\mathbf{v} + \mu\mathbf{v}^\perp \qquad N_k:r_k\mathbf{w} + \nu\mathbf{w}^\perp \qquad \qquad i,j,k = 1,\ldots, n, \quad \lambda, \mu, \nu \in \mathbb{R}.$$

We are interested in finding the triplets $(i,j,k)$ where $L_i,M_j,N_k$ are concurrent. I have been able to construct an algorithm that does this in $\mathcal{O}(n^2)$ but I cannot prove that there is no faster algorithm.

For the sake of completion, I will add the current working algorithm here.


With the appropriate transformation, we can assume $\mathbf{u}^\perp,\mathbf{v}^\perp,\mathbf{w}^\perp$ are in the first quadrant, and none is aligned with the vertical axis. Without loss of generality we can assume the also are in increasing order of angle with the horizontal axis.

counter = n
for j in range n:
      i = 0, k = 0
      found = False
      while not Found:
            A = intersection(L[i],M[j])
            B = intersection(M[j],N[k])
            if A[0] == B[0]
                  found = True
                  del L[i]
                  del N[k]
                  counter--
                  answer = A
            elif A[0] < B[0]:
                  i++
            else:
                  k++
      print answer
Rushabh Mehta
  • 13,845
Darth Geek
  • 12,543
  • Since you said "quadrant" I assume you are working in the Euclidean plane? How do you define 'perpendicular vector', since there are multiple that could work? I guess it doesn't matter for the rest of your definition of a line... – orlp Aug 14 '20 at 12:38
  • 1
    This answer gives a formula for the area of a triangle given the eqns of its side-lines; the numerator is $$p\sin P+q\sin Q+r\sin R$$ where $p$, $q$, $r$ are lengths of normals, and $P$, $Q$, $R$ are angles between two normals. Your $u$, $v$, $w$ are (presumably) unit normals, so that $p_i$, $q_j$, $r_k$ act as $p$, $q$, $r$. Pre-compute sinP (for $P$ the angle between $v$ and $w$), sinQ, sinR. Then the test for concurrency is P[i]*sinP+Q[j]*sinQ+R[k]*sinR==0. This doesn't reduce computational complexity, but it simplifies the code. – Blue Aug 14 '20 at 12:59
  • @orlp indeed, we are considering the Euclidean plane. Either perpendicular works but we can make an appropriate choice so that all three belong to the same half-plane, then a skew transformation and a rotation will make it so that all three are on the first quadrant. – Darth Geek Aug 17 '20 at 08:34
  • @Blue how would I use that information to turn it into an algorithm that runs in quadratic time? Wouldn't it end up being cubic? – Darth Geek Aug 17 '20 at 08:37

0 Answers0