Line–sphere intersection

Last updated
The three possible line-sphere intersections:
1. No intersection.
2. Point intersection.
3. Two point intersection. Line-Sphere Intersection Cropped.png
The three possible line-sphere intersections:
1. No intersection.
2. Point intersection.
3. Two point intersection.

In analytic geometry, a line and a sphere can intersect in three ways:

Contents

  1. No intersection at all
  2. Intersection in exactly one point
  3. Intersection in two points.

Methods for distinguishing these cases, and determining the coordinates for the points in the latter cases, are useful in a number of circumstances. For example, it is a common calculation to perform during ray tracing. [1]

Calculation using vectors in 3D

In vector notation, the equations are as follows:

Equation for a sphere

  •  : points on the sphere
  •  : center point
  •  : radius of the sphere

Equation for a line starting at

  •  : points on the line
  •  : origin of the line
  •  : distance from the origin of the line
  •  : direction of line (a non-zero vector)

Searching for points that are on the line and on the sphere means combining the equations and solving for , involving the dot product of vectors:

Equations combined
Expanded and rearranged:
The form of a quadratic formula is now observable. (This quadratic equation is an instance of Joachimsthal's equation. [2] )
where
Simplified
Note that in the specific case where is a unit vector, and thus , we can simplify this further to (writing instead of to indicate a unit vector):
  • If , then it is clear that no solutions exist, i.e. the line does not intersect the sphere (case 1).
  • If , then exactly one solution exists, i.e. the line just touches the sphere in one point (case 2).
  • If , two solutions exist, and thus the line touches the sphere in two points (case 3).

See also

Related Research Articles

<span class="mw-page-title-main">Curl (mathematics)</span> Circulation density in a vector field

In vector calculus, the curl, also known as rotor, is a vector operator that describes the infinitesimal circulation of a vector field in three-dimensional Euclidean space. The curl at a point in the field is represented by a vector whose length and direction denote the magnitude and axis of the maximum circulation. The curl of a field is formally defined as the circulation density at each point of the field.

<span class="mw-page-title-main">Ellipsoid</span> Quadric surface that looks like a deformed sphere

An ellipsoid is a surface that can be obtained from a sphere by deforming it by means of directional scalings, or more generally, of an affine transformation.

In vector calculus, the divergence theorem, also known as Gauss's theorem or Ostrogradsky's theorem, is a theorem relating the flux of a vector field through a closed surface to the divergence of the field in the volume enclosed.

In mathematics, the Laplace operator or Laplacian is a differential operator given by the divergence of the gradient of a scalar function on Euclidean space. It is usually denoted by the symbols , (where is the nabla operator), or . In a Cartesian coordinate system, the Laplacian is given by the sum of second partial derivatives of the function with respect to each independent variable. In other coordinate systems, such as cylindrical and spherical coordinates, the Laplacian also has a useful form. Informally, the Laplacian Δf (p) of a function f at a point p measures by how much the average value of f over small spheres or balls centered at p deviates from f (p).

In fluid dynamics, Stokes' law is an empirical law for the frictional force – also called drag force – exerted on spherical objects with very small Reynolds numbers in a viscous fluid. It was derived by George Gabriel Stokes in 1851 by solving the Stokes flow limit for small Reynolds numbers of the Navier–Stokes equations.

<span class="mw-page-title-main">Stream function</span> Function for incompressible divergence-free flows in two dimensions

In fluid dynamics, two types of stream function are defined:

In vector calculus, Green's theorem relates a line integral around a simple closed curve C to a double integral over the plane region D bounded by C. It is the two-dimensional special case of Stokes' theorem.

In mathematics, the covariant derivative is a way of specifying a derivative along tangent vectors of a manifold. Alternatively, the covariant derivative is a way of introducing and working with a connection on a manifold by means of a differential operator, to be contrasted with the approach given by a principal connection on the frame bundle – see affine connection. In the special case of a manifold isometrically embedded into a higher-dimensional Euclidean space, the covariant derivative can be viewed as the orthogonal projection of the Euclidean directional derivative onto the manifold's tangent space. In this case the Euclidean derivative is broken into two parts, the extrinsic normal component and the intrinsic covariant derivative component.

In vector calculus, a conservative vector field is a vector field that is the gradient of some function. A conservative vector field has the property that its line integral is path independent; the choice of path between two points does not change the value of the line integral. Path independence of the line integral is equivalent to the vector field under the line integral being conservative. A conservative vector field is also irrotational; in three dimensions, this means that it has vanishing curl. An irrotational vector field is necessarily conservative provided that the domain is simply connected.

In differential geometry, the four-gradient is the four-vector analogue of the gradient from vector calculus.

In geometry, the circumscribed circle or circumcircle of a triangle is a circle that passes through all three vertices. The center of this circle is called the circumcenter of the triangle, and its radius is called the circumradius. The circumcenter is the point of intersection between the three perpendicular bisectors of the triangle's sides, and is a triangle center.

<span class="mw-page-title-main">Three-dimensional space</span> Geometric model of the physical space

In geometry, a three-dimensional space is a mathematical space in which three values (coordinates) are required to determine the position of a point. Most commonly, it is the three-dimensional Euclidean space, that is, the Euclidean space of dimension three, which models physical space. More general three-dimensional spaces are called 3-manifolds. The term may also refer colloquially to a subset of space, a three-dimensional region, a solid figure.

<span class="mw-page-title-main">Beltrami–Klein model</span> Model of hyperbolic geometry

In geometry, the Beltrami–Klein model, also called the projective model, Klein disk model, and the Cayley–Klein model, is a model of hyperbolic geometry in which points are represented by the points in the interior of the unit disk and lines are represented by the chords, straight line segments with ideal endpoints on the boundary sphere.

<span class="mw-page-title-main">Navier–Stokes existence and smoothness</span> Millennium Prize Problem

The Navier–Stokes existence and smoothness problem concerns the mathematical properties of solutions to the Navier–Stokes equations, a system of partial differential equations that describe the motion of a fluid in space. Solutions to the Navier–Stokes equations are used in many practical applications. However, theoretical understanding of the solutions to these equations is incomplete. In particular, solutions of the Navier–Stokes equations often include turbulence, which remains one of the greatest unsolved problems in physics, despite its immense importance in science and engineering.

<span class="mw-page-title-main">Euclidean plane</span> Geometric model of the planar projection of the physical universe

In mathematics, a Euclidean plane is a Euclidean space of dimension two, denoted or . It is a geometric space in which two real numbers are required to determine the position of each point. It is an affine space, which includes in particular the concept of parallel lines. It has also metrical properties induced by a distance, which allows to define circles, and angle measurement.

In fluid dynamics, the Oseen equations describe the flow of a viscous and incompressible fluid at small Reynolds numbers, as formulated by Carl Wilhelm Oseen in 1910. Oseen flow is an improved description of these flows, as compared to Stokes flow, with the (partial) inclusion of convective acceleration.

<span class="mw-page-title-main">Poincaré disk model</span> Model of hyperbolic geometry

In geometry, the Poincaré disk model, also called the conformal disk model, is a model of 2-dimensional hyperbolic geometry in which all points are inside the unit disk, and straight lines are either circular arcs contained within the disk that are orthogonal to the unit circle or diameters of the unit circle.

Hamiltonian optics and Lagrangian optics are two formulations of geometrical optics which share much of the mathematical formalism with Hamiltonian mechanics and Lagrangian mechanics.

Lagrangian field theory is a formalism in classical field theory. It is the field-theoretic analogue of Lagrangian mechanics. Lagrangian mechanics is used to analyze the motion of a system of discrete particles each with a finite number of degrees of freedom. Lagrangian field theory applies to continua and fields, which have an infinite number of degrees of freedom.

<span class="mw-page-title-main">Line-cylinder intersection</span> Geometry calculation

Line-cylinder intersection is the calculation of any points of intersection, given an analytic geometry description of a line and a cylinder in 3d space.

References

  1. Eberly, David H. (2006). 3D game engine design: a practical approach to real-time computer graphics, 2nd edition. Morgan Kaufmann. p. 698. ISBN   0-12-229063-1.
  2. "Joachimsthal's Equation".