Skip to content

Instantly share code, notes, and snippets.

@gagern
Last active December 2, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gagern/5a1d6d4663c3da6f52dd to your computer and use it in GitHub Desktop.
Save gagern/5a1d6d4663c3da6f52dd to your computer and use it in GitHub Desktop.
Singularities of paraboly by focus and directrix

Parabola by focus and directrix

Algorithm originally written in JavaScript for CindyJS by Alexander Elkins. See CindyJS#120 for context.

This is a reformulation for Sage, to investigate singular situations.

# A Polynomial ring over the rationals with six indeterminates
PR.<Fx,Fy,Fz,dx,dy,dz> = QQ[]
A = vector([Fx,Fy,Fz]) # Focus point
a = vector([dx,dy,dz]) # Directrix line
linfty = vector(PR, [0,0,1])
dd = a.cross_product(linfty) # The direction of the directrix line
dp = dd.cross_product(linfty) # The perpendicular direction of the directrix line
e = A.cross_product(dd) # Parallel line through focus point in the direction of the directrix line forms both lines of one degenerate conic
b = A.cross_product(dp) # Line through focus point in the perpendicular direction of directrix line
B = a.cross_product(b) # Point B is the projection of the focus point onto the directrix line
c = B.cross_product(dd - dp) # Create both both angle bisector lines through point B from the
d = B.cross_product(dd + dp) # direction of the directrix and its perpendicular direction
C = B[2]*A + A[2]*B # Midpoint of point A and point B
deg1 = c.column() * d.row() # One degenerate conic with factors c and d
deg2 = e.column() * e.row() # Another with e as a double line
m = (C*deg1*C)*deg2 - (C*deg2*C)*deg1 # Pick from pencil to coincide with C
m += m.transpose() # Symmetrize

The resulting matrix has some removable singularities, recognizable as factors common to all entries:

sage: factor(gcd(m.list()))
Fz^4 * (Fx*dx + Fy*dy + Fz*dz)^2 * (dx^2 + dy^2)^4

After removal of this term, the matrix looks somewhat simpler:

sage: m2 = (m/gcd(m.list())/2).change_ring(PR); m2
⎛                            Fz^2*dy^2                            -Fz^2*dx*dy                      -Fx*Fz*dx^2 - Fx*Fz*dy^2 - Fz^2*dx*dz⎞
⎜                          -Fz^2*dx*dy                              Fz^2*dx^2                      -Fy*Fz*dx^2 - Fy*Fz*dy^2 - Fz^2*dy*dz⎟
⎝-Fx*Fz*dx^2 - Fx*Fz*dy^2 - Fz^2*dx*dz  -Fy*Fz*dx^2 - Fy*Fz*dy^2 - Fz^2*dy*dz  Fx^2*dx^2 + Fy^2*dx^2 + Fx^2*dy^2 + Fy^2*dy^2 - Fz^2*dz^2⎠

Factorizing the individual terms doesn't help with the bottom-right entry.

sage: m2.apply_map(lambda x: SR(factor(x)))
⎛                         Fz^2*dy^2                          -Fz^2*dx*dy                         -(Fx*dx^2 + Fx*dy^2 + Fz*dx*dz)*Fz⎞
⎜                       -Fz^2*dx*dy                            Fz^2*dx^2                         -(Fy*dx^2 + Fy*dy^2 + Fz*dy*dz)*Fz⎟
⎝-(Fx*dx^2 + Fx*dy^2 + Fz*dx*dz)*Fz   -(Fy*dx^2 + Fy*dy^2 + Fz*dy*dz)*Fz  Fx^2*dx^2 + Fy^2*dx^2 + Fx^2*dy^2 + Fy^2*dy^2 - Fz^2*dz^2⎠

Are there any other situations where the result is the zero matrix?

sage: ideal(m2.list()).dimension()
4

Two of these dimensions should account for the choice of representatives, and therefore be without geometric meaning. Which means that there should be a two-parameter family of situations which are still degenerate.

If any of those had the focus at a finite point, then they should be invariant under translations of that focus. So without loss of generality we could choose Fx=0,Fy=0,Fz=1 and find

sage: ideal(m2.list()+[Fx,Fy,Fz-1]).dimension()
0
sage: ideal(m2.list()+[Fx,Fy,Fz-1]).variety(QQbar)
[{dz: 0, dx: 0, dy: 0, Fx: 0, Fy: 0, Fz: 1}]

So there are no degenerate situations left where the focus is finite and the directrix is well-defined (non-null). A degenerate situation with a focus at infinity should be invariant under rotations, so again without loss of generality we may choose Fx=1,Fy=0,Fz=0 to find

sage: ideal(m2.list()+[Fx-1,Fy,Fz]).dimension()
2
sage: ideal(m2.list()+[Fx-1,Fy,Fz,dx,dz]).variety(QQbar)
[{dz: 0, dx: 0, dy: 0, Fx: 1, Fy: 0, Fz: 0}]
sage: ideal(m2.list()+[Fx-1,Fy,Fz,dx-1,dz]).variety(QQbar)
[{dz: 0, dx: 1, dy: -1*I, Fx: 1, Fy: 0, Fz: 0},
 {dz: 0, dx: 1, dy: 1*I, Fx: 1, Fy: 0, Fz: 0}]

The dimension tells us that this is indeed the situation we're after: still two degrees of freedom, after we fixed the representative and the direction of the focus. If we assume that the second line is finite, then we may assume without loss of generality that it passes through the origin, i.e. dz=0. We can distinguish two cases, namely dx=0and dx≠0. The former leads to a degenerate situation only if the directrix is ill-defined. The latter is the really interesting part, and shows that there is a certain complex relation between focus and directrix which still leads to degenerate situations. Since objects with complex coordinates are so hard to visualize, I don't have any proper geometric interpretation of this situation yet.

Since the above assumed the directrix to be a finite line, let's check the sole remaining case:

sage: m2(Fx=1,Fy=0,Fz=0,dx=0,dy=0,dz=1)
⎛0 0 0⎞
⎜0 0 0⎟
⎝0 0 0⎠

So we can summarize that if we get rid of those common factors in the matrix, then the only degenerate situations are these:

  • Either the focus or the directrix is the null vector
  • The focus is a point at infinity and the directrix is the line at infinity
  • The focus is a point at infinity, the directrix is a finite line, and at least one of them has rather specific complex coordinates

So we really should try to get rid of these common factors. Can we somehow describe the degenerate conics in a better way to avoid them being null?

sage: factor(gcd(deg1.list()))
(dx^2 + dy^2)^2
sage: factor(gcd(deg2.list()))
1

Unfortunately the answer to this is no. At least for the majority of cases, the degenerate conics will be non-zero even if the resulting matrix is zero. Which means the aproach over these particular degenerate conics won't be able to cover all the degenerate cases we want covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment