
In
analytic geometry, a
line
Line most often refers to:
* Line (geometry), object with zero thickness and curvature that stretches to infinity
* Telephone line, a single-user circuit on a telephone communication system
Line, lines, The Line, or LINE may also refer to:
Art ...
and a
sphere
A sphere () is a Geometry, geometrical object that is a solid geometry, three-dimensional analogue to a two-dimensional circle. A sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
can
intersect
Intersection or intersect may refer to:
* Intersection in mathematics, including:
** Intersection (set theory), the set of elements common to some collection of sets
** Intersection (geometry)
** Intersection theory
* Intersection (road), a pl ...
in three ways:
# No intersection at all
# Intersection in exactly one point
# Intersection in two points.
Methods for distinguishing these cases, and determining the
coordinates
In geometry, a coordinate system is a system that uses one or more numbers, or coordinates, to uniquely determine the position of the points or other geometric elements on a manifold such as Euclidean space. The order of the coordinates is si ...
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.
Calculation using vectors in 3D
In
vector notation
In mathematics and physics, vector notation is a commonly used notation for representing vectors, which may be Euclidean vectors, or more generally, members of a vector space.
For representing a vector, the common typographic convention is ...
, the equations are as follows:
Equation for a
sphere
A sphere () is a Geometry, geometrical object that is a solid geometry, three-dimensional analogue to a two-dimensional circle. A sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
:
:*
: 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
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an alg ...
of vectors:
:Equations combined
::
:Expanded and rearranged:
::
:The form of a
quadratic formula
In elementary algebra, the quadratic formula is a formula that provides the solution(s) to a quadratic equation. There are other ways of solving a quadratic equation instead of using the quadratic formula, such as factoring (direct factoring, g ...
is now observable. (This quadratic equation is an instance of Joachimsthal's equation.
)
::
:where
:*
:*