Line–plane intersection  In analytic geometry, the intersection of a line and a plane in three-dimensional space can be the empty set, a point, or a line. It is the entire line if that line is embedded in the plane, and is the empty set if the line is parallel to the plane but outside it. Otherwise, the line cuts through the plane at a single point. Distinguishing these cases, and determining equations for the point and line in the latter cases, have use in computer graphics, motion planning, and collision detection. In vector notation, a plane can be expressed as the set of points formula_1 for which where formula_3 is a normal vector to the plane and formula_4 is a point on the plane. (The notation formula_5 denotes the dot product of the vectors formula_6 and formula_7.) The vector equation for a line is where formula_9 is a vector in the direction of the line, formula_10 is a point on the line, and formula_11 is a scalar in the real number domain. Substituting the equation for the line into the equation for the plane gives Expanding gives And solving for formula_11 gives  If formula_16 then the line and plane are parallel. There will be two cases: if formula_17 then the line is contained in the plane, that is, the line intersects the plane at each point of the line. Otherwise, the line and plane have no intersection. If formula_18 there is a single point of intersection. The value of formula_11 can be calculated and the point of intersection is given by  A line is described by all points that are a given direction from a point. A general point on a line passing through points formula_21 and formula_22 can be represented as   where formula_24 is the vector pointing from formula_25 to formula_26. Similarly a general point on a plane determined by the triangle defined by the points formula_27, formula_28 and formula_29 can be represented as  where formula_31 is the vector pointing from formula_32 to formula_33, and formula_34 is the vector pointing from formula_32 to formula_36. The point at which the line intersects the plane is therefore described by setting the point on the line equal to the point on the plane, giving the parametric equation: This can be rewritten as which can be expressed in matrix form as where the vectors are written as column vectors. This produces a system of linear equations which can be solved for formula_40, formula_41 and formula_42.