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">Wave equation</span> Differential equation important in physics

The wave equation is a second-order linear partial differential equation for the description of waves or standing wave fields such as mechanical waves or electromagnetic waves. It arises in fields like acoustics, electromagnetism, and fluid dynamics.

<span class="mw-page-title-main">Laplace's equation</span> Second-order partial differential equation

In mathematics and physics, Laplace's equation is a second-order partial differential equation named after Pierre-Simon Laplace, who first studied its properties. This is often written as

<span class="mw-page-title-main">Navier–Stokes equations</span> Equations describing the motion of viscous fluid substances

The Navier–Stokes equations are partial differential equations which describe the motion of viscous fluid substances. They were named after French engineer and physicist Claude-Louis Navier and the Irish physicist and mathematician George Gabriel Stokes. They were developed over several decades of progressively building the theories, from 1822 (Navier) to 1842–1850 (Stokes).

<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.

<span class="mw-page-title-main">Dihedral angle</span> Angle between two planes in space

A dihedral angle is the angle between two intersecting planes or half-planes. In chemistry, it is the clockwise angle between half-planes through two sets of three atoms, having two atoms in common. In solid geometry, it is defined as the union of a line and two half-planes that have this line as a common edge. In higher dimensions, a dihedral angle represents the angle between two hyperplanes. The planes of a flying machine are said to be at positive dihedral angle when both starboard and port main planes are upwardly inclined to the lateral axis; when downwardly inclined they are said to be at a negative dihedral angle.

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 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">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.

<span class="mw-page-title-main">Kepler orbit</span> Celestial orbit whose trajectory is a conic section in the orbital plane

In celestial mechanics, a Kepler orbit is the motion of one body relative to another, as an ellipse, parabola, or hyperbola, which forms a two-dimensional orbital plane in three-dimensional space. A Kepler orbit can also form a straight line. It considers only the point-like gravitational attraction of two bodies, neglecting perturbations due to gravitational interactions with other objects, atmospheric drag, solar radiation pressure, a non-spherical central body, and so on. It is thus said to be a solution of a special case of the two-body problem, known as the Kepler problem. As a theory in classical mechanics, it also does not take into account the effects of general relativity. Keplerian orbits can be parametrized into six orbital elements in various ways.

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.

In mathematics, a line integral is an integral where the function to be integrated is evaluated along a curve. The terms path integral, curve integral, and curvilinear integral are also used; contour integral is used as well, although that is typically reserved for line integrals in the complex plane.

<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.

<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".