Parametrising the intersection of a sphere and plane with the aid of GeoGebra
Work done in collaboration with Bradley Welch
Part 1:
Context and problem formulation
Main Problem: Find the parametrisation of the intersection curve of a sphere and a plane.
Part 1: Context and problem formulation
Part 1: Context and problem formulation
Sphere of radius R>0, centred at (x0,y0,z0):
Plane defined by:
A,B and C real constants, not all simultaneaously zero.
Part 1: Context and problem formulation
Let ρ be the shortest signed distance between the centre of the sphere and the plane.
That is,
Part 1: Context and problem formulation
We can set the following cases for the intersection Π∩S:
1. If ∣ρ∣<R, then Π∩S is a circle.
2. If ∣ρ∣=R, then Π∩S is a point.
3. If ∣ρ∣>R, then Π∩S is a empty.
Part 1: Context and problem formulation
Part 1: Context and problem formulation
Find the parametrisation of the intersection curve of a sphere and a plane.
or
Conjecture: The solution provided by Geogebra takes the general vector form given as
The dynamic exploration in GeoGebra with different semiotic representations provides some clues to solve our main problem:
Part 1: Context and problem formulation
Conjecture: The solution provided by Geogebra takes the general vector form given as
Part 2: Learning trajectory
Part 2: Learning trajectory
Problem 1: Find the parametric equation of the curve obtained by intersecting the sphere S:x2+y2+z2=1 and the plane Π:z=21.
Find the parametrisation of the intersection curve of a sphere and a plane.
Before solving the general problem:
Let's try to relax the conditions and solve the simplest case:
Part 2: Learning trajectory
Problem 1: Find the parametric equation of the curve obtained by intersecting the sphere S:x2+y2+z2=1 and the plane Π:z=21.
Substitute z=21 in the equation of the sphere:
x2+y2+(21)2=1
Using the identity cos2(t)+sin2(t)=1
⇒34x2+34y2=1
Part 2: Learning trajectory
Part 2: Learning trajectory
Part 2: Learning trajectory
Problem 2: Compute the parametric equations of the curve obtained by intersecting the sphere and plane given by
S:x2+y2+z2=4 and Π:2x+2y+z=−3,
respectively.
Rewrite the plane as z=−3−2x−2y
Then we obtain x2+y2+(−3−2−x−2y)2=4
That is 5x2+8xy+5y2+12x+12y+5=0
This is a conic section, also known as a quadratic form in R2, and can be written in matrix form as
xTMx+Kx+f=0
Now let's try a slightly more difficult problem!
Part 2: Learning trajectory
Problem 2: Compute the parametric equations of the curve obtained by intersecting the sphere and plane given by
S:x2+y2+z2=4 and Π:2x+2y+z=−3,
respectively.
That is 5x2+8xy+5y2+12x+12y+5=0
Let x=(xy).
xTMx+Kx+f=0
Then we have
By means of a rotation of the plane about the origin, a translation of the plane, or both, it is possible to represent every conic in a simplified standard, or canonical, form.
Part 2: Learning trajectory
That is 5x2+8xy+5y2+12x+12y+5=0
xTMx+Kx+f=0
By means of a rotation of the plane about the origin, a translation of the plane, or both, it is possible to represent every conic in a simplified standard, or canonical, form.
This process is known as diagonalisation of quadratic forms.
Let x=(xy).
Then we have
Problem 2: Compute the parametric equations of the curve obtained by intersecting the sphere and plane given by
S:x2+y2+z2=4 and Π:2x+2y+z=−3,
respectively.
Part 2: Learning trajectory
That is 5x2+8xy+5y2+12x+12y+5=0
xTMx+Kx+f=0
Let x=(xy).
Then we have
The diagonalisation process and a change of variables provides the following expression:
the simplified standard form of
Problem 2: Compute the parametric equations of the curve obtained by intersecting the sphere and plane given by
S:x2+y2+z2=4 and Π:2x+2y+z=−3,
respectively.
Part 2: Learning trajectory
Using again the identity cos2(t)+sin2(t)=1 and rewriting everything back with the variables x,y and z;
Problem 2: Compute the parametric equations of the curve obtained by intersecting the sphere and plane given by
S:x2+y2+z2=4 and Π:2x+2y+z=−3,
respectively.
we obtain the solution:
Part 2: Learning trajectory
Part 2: Learning trajectory
Problem 3: Find the parametrisation of the intersection curve of the sphere and plane ⎩⎨⎧S:Π:(x−x0)2+(y−y0)2+(z−z0)2=R2Ax+By+Cz=D, where A,B,C are not all simultaneously zero.
General problem!
To simplify some calculations, first we translate both objects to the origin: ⎩⎨⎧S0:Π0:x2+y2+z2=R2A(x+x0)+B(y+y0)+C(z+z0)=D
Part 2: Learning trajectory
Problem 3: Find the parametrisation of the intersection curve of the sphere and plane ⎩⎨⎧S:Π:(x−x0)2+(y−y0)2+(z−z0)2=R2Ax+By+Cz=D, where A,B,C are not all simultaneously zero.
Substituing the equation of the plane Π0 into the sphere S0 yields
⎩⎨⎧S0:Π0:x2+y2+z2=R2A(x+x0)+B(y+y0)+C(z+z0)=D
Part 2: Learning trajectory
Problem 3: Find the parametrisation of the intersection curve of the sphere and plane ⎩⎨⎧S:Π:(x−x0)2+(y−y0)2+(z−z0)2=R2Ax+By+Cz=D, where A,B,C are not all simultaneously zero.
This expression is in fact a quadratic form:
ax2+bxy+cy2+dx+ey+f=0
So we can rewrite it as
xTMx+Kx+f=0
Thus we can apply the process of diagonalisation
to obtain the solution of the general problem.
Part 2: Learning trajectory
Problem 3: Find the parametrisation of the intersection curve of the sphere and plane ⎩⎨⎧S:Π:(x−x0)2+(y−y0)2+(z−z0)2=R2Ax+By+Cz=D, where A,B,C are not all simultaneously zero.
Thus we can apply the process of diagonalisation
to obtain the solution of the general problem.
Part 3: Final comments
Part 3: Final comments
Part 3: Final comments
xTMx+Kx+f=0
Part 3: Final comments
Algebraic view
CAS view
3D view
Part 3: Final comments
Algebraic view
CAS view
3D view
Part 3: Final comments
/*
GeoGebra - Dynamic Mathematics for Everyone
http://www.geogebra.org
This file is part of GeoGebra.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation.
*/
/*
* AlgoJoinPointsSegment
*
* Created on 21. August 2003
*/
package org.geogebra.common.geogebra3D.kernel3D.algos;
import org.geogebra.common.geogebra3D.kernel3D.geos.GeoConic3D;
import org.geogebra.common.kernel.Construction;
import org.geogebra.common.kernel.StringTemplate;
import org.geogebra.common.kernel.commands.Commands;
import org.geogebra.common.kernel.geos.GeoElement;
import org.geogebra.common.kernel.kernelND.GeoCoordSys2D;
import org.geogebra.common.kernel.kernelND.GeoQuadricND;
import org.geogebra.common.kernel.matrix.CoordMatrix;
/**
*
* @author ggb3D
*
*/
public class AlgoIntersectPlaneQuadric extends AlgoElement3D {
// inputs
/** plane */
protected GeoCoordSys2D plane;
/** second coord sys */
protected GeoQuadricND quadric;
// output
/** intersection */
protected GeoConic3D conic;
private CoordMatrix cm = new CoordMatrix(3, 3);
private CoordMatrix tmpMatrix = new CoordMatrix(3, 4);
private CoordMatrix parametricMatrix;
/**
* Creates new AlgoIntersectLinePlane
*
* @param cons
* the construction
* @param plane
* plane
* @param quadric
* quadric
* @param addToCons
* whether to add to cons
*/
AlgoIntersectPlaneQuadric(Construction cons, GeoCoordSys2D plane,
GeoQuadricND quadric, boolean addToCons) {
super(cons, addToCons);
this.plane = plane;
this.quadric = quadric;
conic = newConic(cons);
// end
if (addToCons) {
end();
}
}
/**
* Creates new AlgoIntersectLinePlane
*
* @param cons
* the construction
* @param plane
* plane
* @param quadric
* quadric
*/
AlgoIntersectPlaneQuadric(Construction cons, GeoCoordSys2D plane,
GeoQuadricND quadric) {
this(cons, plane, quadric, true);
}
/**
* end of contructor for this algo
*/
protected void end() {
setInputOutput(new GeoElement[] { plane.toGeoElement(), quadric },
new GeoElement[] { conic });
}
/**
*
* @param cons1
* construction
* @return new conic for intersection
*/
protected GeoConic3D newConic(Construction cons1) {
return new GeoConic3D(cons1, true);
}
/**
* return the intersection
*
* @return the intersection
*/
public GeoConic3D getConic() {
return conic;
}
// /////////////////////////////////////////////
// COMPUTE
@Override
public void compute() {
conic.setCoordSys(plane.getCoordSys());
if (!quadric.isDefined() || !plane.isDefined()) {
conic.setUndefined();
return;
}
intersectPlaneQuadric(plane, quadric, conic);
}
private void intersectPlaneQuadric(GeoCoordSys2D inputPlane,
GeoQuadricND inputQuad, GeoConic3D outputConic) {
if (parametricMatrix == null) {
parametricMatrix = new CoordMatrix(4, 3);
}
CoordMatrix qm = inputQuad.getSymetricMatrix();
CoordMatrix pm = inputPlane.getCoordSys()
.getParametricMatrix(parametricMatrix);
// sets the conic matrix from plane and quadric matrix
cm.setMul(tmpMatrix.setMulT1(pm, qm), pm);
outputConic.setCoordSys(inputPlane.getCoordSys());
outputConic.setMatrix(cm);
}
@Override
public Commands getClassName() {
return Commands.IntersectPath;
}
@Override
final public String toString(StringTemplate tpl) {
StringBuilder sb = new StringBuilder();
sb.append(getLoc().getPlain("IntersectionCurveOfAB",
plane.getLabel(tpl), quadric.getLabel(tpl)));
return sb.toString();
}
}
We need to study the source code of GeoGebra, which is written in Java.
For example this: