12.1: Vectors in Space

Learning Objectives

  • Describe three-dimensional space mathematically.
  • Locate points in space using coordinates.
  • Write the distance formula in three dimensions.
  • Write the equations for simple planes and spheres.
  • Perform vector operations in (mathbb{R}^{3}).

Vectors are useful tools for solving two-dimensional problems. To expand the use of vectors to more realistic applications, it is necessary to create a framework for describing three-dimensional space. For example, although a two-dimensional map is a useful tool for navigating from one place to another, in some cases the topography of the land is important. Does your planned route go through the mountains? Do you have to cross a river? To appreciate fully the impact of these geographic features, you must use three dimensions. This section presents a natural extension of the two-dimensional Cartesian coordinate plane into three dimensions.

Three-Dimensional Coordinate Systems

As we have learned, the two-dimensional rectangular coordinate system contains two perpendicular axes: the horizontal (x)-axis and the vertical (y)-axis. We can add a third dimension, the (z)-axis, which is perpendicular to both the (x)-axis and the (y)-axis. We call this system the three-dimensional rectangular coordinate system. It represents the three dimensions we encounter in real life.

Definition: Three-dimensional Rectangular Coordinate System

The three-dimensional rectangular coordinate system consists of three perpendicular axes: the (x)-axis, the (y)-axis, and the (z)-axis. Because each axis is a number line representing all real numbers in (ℝ), the three-dimensional system is often denoted by (ℝ^3).

In Figure (PageIndex{1a}), the positive (z)-axis is shown above the plane containing the (x)- and (y)-axes. The positive (x)-axis appears to the left and the positive (y)-axis is to the right. A natural question to ask is: How was this arrangement determined? The system displayed follows the right-hand rule. If we take our right hand and align the fingers with the positive (x)-axis, then curl the fingers so they point in the direction of the positive (y)-axis, our thumb points in the direction of the positive (z)-axis (Figure (PageIndex{1b})). In this text, we always work with coordinate systems set up in accordance with the right-hand rule. Some systems do follow a left-hand rule, but the right-hand rule is considered the standard representation.

In two dimensions, we describe a point in the plane with the coordinates ((x,y)). Each coordinate describes how the point aligns with the corresponding axis. In three dimensions, a new coordinate, (z), is appended to indicate alignment with the (z)-axis: ((x,y,z)). A point in space is identified by all three coordinates (Figure (PageIndex{2})). To plot the point ((x,y,z)), go (x) units along the (x)-axis, then (y) units in the direction of the (y)-axis, then (z) units in the direction of the (z)-axis.

Example (PageIndex{1}): Locating Points in Space

Sketch the point ((1,−2,3)) in three-dimensional space.


To sketch a point, start by sketching three sides of a rectangular prism along the coordinate axes: one unit in the positive (x) direction, (2) units in the negative (y) direction, and (3) units in the positive (z) direction. Complete the prism to plot the point (Figure).

Exercise (PageIndex{1})

Sketch the point ((−2,3,−1)) in three-dimensional space.


Start by sketching the coordinate axes. e.g., Figure (PageIndex{3}). Then sketch a rectangular prism to help find the point in space.


In two-dimensional space, the coordinate plane is defined by a pair of perpendicular axes. These axes allow us to name any location within the plane. In three dimensions, we define coordinate planes by the coordinate axes, just as in two dimensions. There are three axes now, so there are three intersecting pairs of axes. Each pair of axes forms a coordinate plane: the (xy)-plane, the (xz)-plane, and the (yz)-plane (Figure (PageIndex{3})). We define the (xy)-plane formally as the following set: ({(x,y,0):x,y∈ℝ}.) Similarly, the (xz)-plane and the (yz)-plane are defined as ({(x,0,z):x,z∈ℝ}) and ({(0,y,z):y,z∈ℝ},) respectively.

To visualize this, imagine you’re building a house and are standing in a room with only two of the four walls finished. (Assume the two finished walls are adjacent to each other.) If you stand with your back to the corner where the two finished walls meet, facing out into the room, the floor is the (xy)-plane, the wall to your right is the (xz)-plane, and the wall to your left is the (yz)-plane.

In two dimensions, the coordinate axes partition the plane into four quadrants. Similarly, the coordinate planes divide space between them into eight regions about the origin, called octants. The octants fill (ℝ^3) in the same way that quadrants fill (ℝ^2), as shown in Figure (PageIndex{4}).

Most work in three-dimensional space is a comfortable extension of the corresponding concepts in two dimensions. In this section, we use our knowledge of circles to describe spheres, then we expand our understanding of vectors to three dimensions. To accomplish these goals, we begin by adapting the distance formula to three-dimensional space.

If two points lie in the same coordinate plane, then it is straightforward to calculate the distance between them. We that the distance (d) between two points ((x_1,y_1)) and ((x_2,y_2)) in the x(y)-coordinate plane is given by the formula


The formula for the distance between two points in space is a natural extension of this formula.

The Distance between Two Points in Space

The distance (d) between points ((x_1,y_1,z_1)) and ((x_2,y_2,z_2)) is given by the formula

[d=sqrt{(x_2−x_1)^2+(y_2−y_1)^2+(z_2−z_1)^2}. label{distanceForm}]

The proof of this theorem is left as an exercise. (Hint: First find the distance (d_1) between the points ((x_1,y_1,z_1)) and ((x_2,y_2,z_1)) as shown in Figure (PageIndex{5}).)

Example (PageIndex{2}): Distance in Space

Find the distance between points (P_1=(3,−1,5)) and (P_2=(2,1,−1).)


Substitute values directly into the distance formula (Equation ef{distanceForm}):

[egin{align*} d(P_1,P_2) &=sqrt{(x_2−x_1)^2+(y_2−y_1)^2+(z_2−z_1)^2} [4pt] &=sqrt{(2−3)^2+(1−(−1))^2+(−1−5)^2} [4pt] &=sqrt{(-1)^2+2^2+(−6)^2} [4pt] &=sqrt{41}. end{align*}]

Exercise (PageIndex{2})

Find the distance between points (P_1=(1,−5,4)) and (P_2=(4,−1,−1)).





Before moving on to the next section, let’s get a feel for how (ℝ^3) differs from (ℝ^2). For example, in (ℝ^2), lines that are not parallel must always intersect. This is not the case in (ℝ^3). For example, consider the line shown in Figure (PageIndex{7}). These two lines are not parallel, nor do they intersect.

Figure (PageIndex{7}): These two lines are not parallel, but still do not intersect.

You can also have circles that are interconnected but have no points in common, as in Figure (PageIndex{8}).

Figure (PageIndex{8}): These circles are interconnected, but have no points in common.

We have a lot more flexibility working in three dimensions than we do if we stuck with only two dimensions.

Writing Equations in (ℝ^3)

Now that we can represent points in space and find the distance between them, we can learn how to write equations of geometric objects such as lines, planes, and curved surfaces in (ℝ^3). First, we start with a simple equation. Compare the graphs of the equation (x=0) in (ℝ), (ℝ^2),and (ℝ^3) (Figure (PageIndex{9})). From these graphs, we can see the same equation can describe a point, a line, or a plane.

In space, the equation (x=0) describes all points ((0,y,z)). This equation defines the (yz)-plane. Similarly, the (xy)-plane contains all points of the form ((x,y,0)). The equation (z=0) defines the (xy)-plane and the equation (y=0) describes the (xz)-plane (Figure (PageIndex{10})).

Understanding the equations of the coordinate planes allows us to write an equation for any plane that is parallel to one of the coordinate planes. When a plane is parallel to the (xy)-plane, for example, the (z)-coordinate of each point in the plane has the same constant value. Only the (x)- and (y)-coordinates of points in that plane vary from point to point.

Equations of Planes Parallel to Coordinate Planes

  1. The plane in space that is parallel to the (xy)-plane and contains point ((a,b,c)) can be represented by the equation (z=c).
  2. The plane in space that is parallel to the (xz)-plane and contains point ((a,b,c)) can be represented by the equation (y=b).
  3. The plane in space that is parallel to the (yz)-plane and contains point ((a,b,c)) can be represented by the equation (x=a).

Example (PageIndex{3}): Writing Equations of Planes Parallel to Coordinate Planes

  1. Write an equation of the plane passing through point ((3,11,7)) that is parallel to the (yz)-plane.
  2. Find an equation of the plane passing through points ((6,−2,9), (0,−2,4),) and ((1,−2,−3).)


  1. When a plane is parallel to the (yz)-plane, only the (y)- and (z)-coordinates may vary. The (x)-coordinate has the same constant value for all points in this plane, so this plane can be represented by the equation (x=3).
  2. Each of the points ((6,−2,9), (0,−2,4),) and ((1,−2,−3)) has the same (y)-coordinate. This plane can be represented by the equation (y=−2).

Exercise (PageIndex{3})

Write an equation of the plane passing through point ((1,−6,−4)) that is parallel to the (xy)-plane.


If a plane is parallel to the (xy)-plane, the z-coordinates of the points in that plane do not vary.



As we have seen, in (ℝ^2) the equation (x=5) describes the vertical line passing through point ((5,0)). This line is parallel to the (y)-axis. In a natural extension, the equation (x=5) in (ℝ^3) describes the plane passing through point ((5,0,0)), which is parallel to the (yz)-plane. Another natural extension of a familiar equation is found in the equation of a sphere.

Definition: Sphere

A sphere is the set of all points in space equidistant from a fixed point, the center of the sphere (Figure (PageIndex{11})), just as the set of all points in a plane that are equidistant from the center represents a circle. In a sphere, as in a circle, the distance from the center to a point on the sphere is called the radius.

The equation of a circle is derived using the distance formula in two dimensions. In the same way, the equation of a sphere is based on the three-dimensional formula for distance.

Standard Equation of a Sphere

The sphere with center ((a,b,c)) and radius (r) can be represented by the equation


This equation is known as the standard equation of a sphere.

Example (PageIndex{4}): Finding an Equation of a Sphere

Find the standard equation of the sphere with center ((10,7,4)) and point ((−1,3,−2)), as shown in Figure (PageIndex{12}).

Figure (PageIndex{12}): The sphere centered at ((10,7,4)) containing point ((−1,3,−2).)


Use the distance formula to find the radius (r) of the sphere:

[egin{align*} r &=sqrt{(−1−10)^2+(3−7)^2+(−2−4)^2} [4pt] &=sqrt{(−11)^2+(−4)^2+(−6)^2} [4pt] &=sqrt{173} end{align*} ]

The standard equation of the sphere is

[(x−10)^2+(y−7)^2+(z−4)^2=173. onumber]

Exercise (PageIndex{4})

Find the standard equation of the sphere with center ((−2,4,−5)) containing point ((4,4,−1).)


First use the distance formula to find the radius of the sphere.


[(x+2)^2+(y−4)^2+(z+5)^2=52 onumber]

Example (PageIndex{5}): Finding the Equation of a Sphere

Let (P=(−5,2,3)) and (Q=(3,4,−1)), and suppose line segment (overline{PQ}) forms the diameter of a sphere (Figure (PageIndex{13})). Find the equation of the sphere.


Since (overline{PQ}) is a diameter of the sphere, we know the center of the sphere is the midpoint of (overline{PQ}).Then,

[C=left(dfrac{−5+3}{2},dfrac{2+4}{2},dfrac{3+(−1)}{2} ight)=(−1,3,1). onumber]

Furthermore, we know the radius of the sphere is half the length of the diameter. This gives

[egin{align*} r &=dfrac{1}{2}sqrt{(−5−3)^2+(2−4)^2+(3−(−1))^2} [4pt] &=dfrac{1}{2}sqrt{64+4+16} [4pt] &=sqrt{21} end{align*}]

Then, the equation of the sphere is ((x+1)^2+(y−3)^2+(z−1)^2=21.)

Exercise (PageIndex{5})

Find the equation of the sphere with diameter (overline{PQ}), where (P=(2,−1,−3)) and (Q=(−2,5,−1).)


Find the midpoint of the diameter first.


[x^2+(y−2)^2+(z+2)^2=14 onumber]

Example (PageIndex{6}): Graphing Other Equations in Three Dimensions

Describe the set of points that satisfies ((x−4)(z−2)=0,) and graph the set.


We must have either (x−4=0) or (z−2=0), so the set of points forms the two planes (x=4) and (z=2) (Figure (PageIndex{14})).

Exercise (PageIndex{6})

Describe the set of points that satisfies ((y+2)(z−3)=0,) and graph the set.


One of the factors must be zero.


The set of points forms the two planes (y=−2) and (z=3).

Example (PageIndex{7}): Graphing Other Equations in Three Dimensions

Describe the set of points in three-dimensional space that satisfies ((x−2)^2+(y−1)^2=4,) and graph the set.


The (x)- and (y)-coordinates form a circle in the (xy)-plane of radius (2), centered at ((2,1)). Since there is no restriction on the (z)-coordinate, the three-dimensional result is a circular cylinder of radius (2) centered on the line with (x=2) and (y=1). The cylinder extends indefinitely in the (z)-direction (Figure (PageIndex{15})).

Exercise (PageIndex{7})

Describe the set of points in three dimensional space that satisfies (x^2+(z−2)^2=16), and graph the surface.


Think about what happens if you plot this equation in two dimensions in the (xz)-plane.


A cylinder of radius 4 centered on the line with (x=0) and (z=2).

Working with Vectors in (ℝ^3)

Just like two-dimensional vectors, three-dimensional vectors are quantities with both magnitude and direction, and they are represented by directed line segments (arrows). With a three-dimensional vector, we use a three-dimensional arrow.

Three-dimensional vectors can also be represented in component form. The notation (vecs{v}=⟨x,y,z⟩) is a natural extension of the two-dimensional case, representing a vector with the initial point at the origin, ((0,0,0)), and terminal point ((x,y,z)). The zero vector is (vecs{0}=⟨0,0,0⟩). So, for example, the three dimensional vector (vecs{v}=⟨2,4,1⟩) is represented by a directed line segment from point ((0,0,0)) to point ((2,4,1)) (Figure (PageIndex{16})).

Vector addition and scalar multiplication are defined analogously to the two-dimensional case. If (vecs{v}=⟨x_1,y_1,z_1⟩) and (vecs{w}=⟨x_2,y_2,z_2⟩) are vectors, and (k) is a scalar, then




If (k=−1,) then (kvecs{v}=(−1)vecs{v}) is written as (−vecs{v}), and vector subtraction is defined by (vecs{v}−vecs{w}=vecs{v}+(−vecs{w})=vecs{v}+(−1)vecs{w}).

The standard unit vectors extend easily into three dimensions as well, (hat{mathbf i}=⟨1,0,0⟩), (hat{mathbf j}=⟨0,1,0⟩), and (hat{mathbf k}=⟨0,0,1⟩), and we use them in the same way we used the standard unit vectors in two dimensions. Thus, we can represent a vector in (ℝ^3) in the following ways:

[vecs{v}=⟨x,y,z⟩=xhat{mathbf i}+yhat{mathbf j}+zhat{mathbf k}].

Example (PageIndex{8}): Vector Representations

Let (vecd{PQ}) be the vector with initial point (P=(3,12,6)) and terminal point (Q=(−4,−3,2)) as shown in Figure (PageIndex{17}). Express (vecd{PQ}) in both component form and using standard unit vectors.


In component form,

[egin{align*} vecd{PQ} =⟨x_2−x_1,y_2−y_1,z_2−z_1⟩ [4pt] =⟨−4−3,−3−12,2−6⟩ [4pt] =⟨−7,−15,−4⟩. end{align*}]

In standard unit form,

[vecd{PQ}=−7hat{mathbf i}−15hat{mathbf j}−4hat{mathbf k}. onumber]

Exercise (PageIndex{8})

Let (S=(3,8,2)) and (T=(2,−1,3)). Express (vec{ST}) in component form and in standard unit form.


Write (vecd{ST}) in component form first. (T) is the terminal point of (vecd{ST}).


(vecd{ST}=⟨−1,−9,1⟩=−hat{mathbf i}−9hat{mathbf j}+hat{mathbf k})

As described earlier, vectors in three dimensions behave in the same way as vectors in a plane. The geometric interpretation of vector addition, for example, is the same in both two- and three-dimensional space (Figure (PageIndex{18})).

We have already seen how some of the algebraic properties of vectors, such as vector addition and scalar multiplication, can be extended to three dimensions. Other properties can be extended in similar fashion. They are summarized here for our reference.

Properties of Vectors in Space

Let (vecs{v}=⟨x_1,y_1,z_1⟩) and (vecs{w}=⟨x_2,y_2,z_2⟩) be vectors, and let (k) be a scalar.

  • Scalar multiplication: [kvecs{v}=⟨kx_1,ky_1,kz_1⟩]
  • Vector addition: [vecs{v}+vecs{w}=⟨x_1,y_1,z_1⟩+⟨x_2,y_2,z_2⟩=⟨x_1+x_2,y_1+y_2,z_1+z_2⟩]
  • Vector subtraction: [vecs{v}−vecs{w}=⟨x_1,y_1,z_1⟩−⟨x_2,y_2,z_2⟩=⟨x_1−x_2,y_1−y_2,z_1−z_2⟩]
  • Vector magnitude: [|vecs{v}|=sqrt{x_1^2+y_1^2+z_1^2}]
  • Unit vector in the direction of (vecs{v}): [dfrac{1}{|vecs{v}|}vecs{v}=dfrac{1}{|vecs{v}|}⟨x_1,y_1,z_1⟩=⟨dfrac{x_1}{|vecs{v}|},dfrac{y_1}{|vecs{v}|},dfrac{z_1}{|vecs{v}|}⟩, quad ext{if} , vecs{v}≠vecs{0}]

We have seen that vector addition in two dimensions satisfies the commutative, associative, and additive inverse properties. These properties of vector operations are valid for three-dimensional vectors as well. Scalar multiplication of vectors satisfies the distributive property, and the zero vector acts as an additive identity. The proofs to verify these properties in three dimensions are straightforward extensions of the proofs in two dimensions.

Example (PageIndex{9}): Vector Operations in Three Dimensions

Let (vecs{v}=⟨−2,9,5⟩) and (vecs{w}=⟨1,−1,0⟩) (Figure (PageIndex{19})). Find the following vectors.

  1. (3vecs{v}−2vecs{w})
  2. (5|vecs{w}|)
  3. (|5 vecs{w}|)
  4. A unit vector in the direction of (vecs{v})


a. First, use scalar multiplication of each vector, then subtract:

[egin{align*} 3vecs{v}−2vecs{w} =3⟨−2,9,5⟩−2⟨1,−1,0⟩ [4pt] =⟨−6,27,15⟩−⟨2,−2,0⟩ [4pt] =⟨−6−2,27−(−2),15−0⟩ [4pt] =⟨−8,29,15⟩. end{align*}]

b. Write the equation for the magnitude of the vector, then use scalar multiplication:

[5|vecs{w}|=5sqrt{1^2+(−1)^2+0^2}=5sqrt{2}. onumber]

c. First, use scalar multiplication, then find the magnitude of the new vector. Note that the result is the same as for part b.:

[|5 vecs{w}|=∥⟨5,−5,0⟩∥=sqrt{5^2+(−5)^2+0^2}=sqrt{50}=5sqrt{2} onumber]

d. Recall that to find a unit vector in two dimensions, we divide a vector by its magnitude. The procedure is the same in three dimensions:

[egin{align*} dfrac{vecs{v}}{|vecs{v}|} =dfrac{1}{|vecs{v}|}⟨−2,9,5⟩ [4pt] =dfrac{1}{sqrt{(−2)^2+9^2+5^2}}⟨−2,9,5⟩ [4pt] =dfrac{1}{sqrt{110}}⟨−2,9,5⟩ [4pt] =⟨dfrac{−2}{sqrt{110}},dfrac{9}{sqrt{110}},dfrac{5}{sqrt{110}}⟩ . end{align*}]

Exercise (PageIndex{9}):

Let (vecs{v}=⟨−1,−1,1⟩) and (vecs{w}=⟨2,0,1⟩). Find a unit vector in the direction of (5vecs{v}+3vecs{w}.)


Start by writing (5vecs{v}+3vecs{w}) in component form.



Example (PageIndex{10}): Throwing a Forward Pass

A quarterback is standing on the football field preparing to throw a pass. His receiver is standing 20 yd down the field and 15 yd to the quarterback’s left. The quarterback throws the ball at a velocity of 60 mph toward the receiver at an upward angle of (30°) (see the following figure). Write the initial velocity vector of the ball, (vecs{v}), in component form.


The first thing we want to do is find a vector in the same direction as the velocity vector of the ball. We then scale the vector appropriately so that it has the right magnitude. Consider the vector (vecs{w}) extending from the quarterback’s arm to a point directly above the receiver’s head at an angle of (30°) (see the following figure). This vector would have the same direction as (vecs{v}), but it may not have the right magnitude.

The receiver is 20 yd down the field and 15 yd to the quarterback’s left. Therefore, the straight-line distance from the quarterback to the receiver is

Dist from QB to receiver(=sqrt{15^2+20^2}=sqrt{225+400}=sqrt{625}=25) yd.

We have (dfrac{25}{|vecs{w}|}=cos 30°.) Then the magnitude of (vecs{w}) is given by

(|vecs{w}|=dfrac{25}{cos 30°}=dfrac{25⋅2}{sqrt{3}}=dfrac{50}{sqrt{3}}) yd

and the vertical distance from the receiver to the terminal point of (vecs{w}) is

Vert dist from receiver to terminal point of (vecs{w}=|vecs{w}| sin 30°=dfrac{50}{sqrt{3}}⋅dfrac{1}{2}=dfrac{25}{sqrt{3}}) yd.

Then (vecs{w}=⟨20,15,dfrac{25}{sqrt{3}}⟩), and has the same direction as (vecs{v}).

Recall, though, that we calculated the magnitude of (vecs{w}) to be (|vecs{w}|=dfrac{50}{sqrt{3}}), and (vecs{v}) has magnitude (60) mph. So, we need to multiply vector (vecs{w}) by an appropriate constant, (k). We want to find a value of (k) so that (∥kvecs{w}∥=60) mph. We have

(|k vecs{w}|=k|vecs{w}|=kdfrac{50}{sqrt{3}}) mph,

so we want






Let’s double-check that (|vecs{v}|=60.) We have

(|vecs{v}|=sqrt{(24sqrt{3})^2+(18sqrt{3})^2+(30)^2}=sqrt{1728+972+900}=sqrt{3600}=60) mph.

So, we have found the correct components for (vecs{v}).

Exercise (PageIndex{10})

Assume the quarterback and the receiver are in the same place as in the previous example. This time, however, the quarterback throws the ball at velocity of (40) mph and an angle of (45°). Write the initial velocity vector of the ball, (vecs{v}), in component form.


Follow the process used in the previous example.



Key Concepts

  • The three-dimensional coordinate system is built around a set of three axes that intersect at right angles at a single point, the origin. Ordered triples ((x,y,z)) are used to describe the location of a point in space.
  • The distance (d) between points ((x_1,y_1,z_1)) and ((x_2,y_2,z_2)) is given by the formula [d=sqrt{(x_2−x_1)^2+(y_2−y_1)^2+(z_2−z_1)^2}. onumber]
  • In three dimensions, the equations (x=a,y=b,) and (z=c) describe planes that are parallel to the coordinate planes.
  • The standard equation of a sphere with center ((a,b,c)) and radius (r) is [(x−a)^2+(y−b)^2+(z−c)^2=r^2. onumber ]
  • In three dimensions, as in two, vectors are commonly expressed in component form, (v=⟨x,y,z⟩), or in terms of the standard unit vectors, (xi+yj+zk.)
  • Properties of vectors in space are a natural extension of the properties for vectors in a plane. Let (v=⟨x_1,y_1,z_1⟩) and (w=⟨x_2,y_2,z_2⟩) be vectors, and let (k) be a scalar.

Scalar multiplication:

[(kvecs{v}=⟨kx_1,ky_1,kz_1⟩ onumber]

Vector addition:

[vecs{v}+vecs{w}=⟨x_1,y_1,z_1⟩+⟨x_2,y_2,z_2⟩=⟨x_1+x_2,y_1+y_2,z_1+z_2⟩ onumber]

Vector subtraction:

[vecs{v}−vecs{w}=⟨x_1,y_1,z_1⟩−⟨x_2,y_2,z_2⟩=⟨x_1−x_2,y_1−y_2,z_1−z_2⟩ onumber]

Vector magnitude:

[‖vecs{v}‖=sqrt{x_1^2+y_1^2+z_1^2} onumber]

Unit vector in the direction of (vecs{v}):

[dfrac{vecs{v}}{‖vecs{v}‖}=dfrac{1}{‖vecs{v}‖}⟨x_1,y_1,z_1⟩=⟨dfrac{x_1}{‖vecs{v}‖},dfrac{y_1}{‖vecs{v}‖},dfrac{z_1}{‖vecs{v}‖}⟩, vecs{v}≠vecs{0} onumber]

Key Equations

Distance between two points in space:


Sphere with center ((a,b,c)) and radius (r):



coordinate plane
a plane containing two of the three coordinate axes in the three-dimensional coordinate system, named by the axes it contains: the (xy)-plane, (xz)-plane, or the (yz)-plane
right-hand rule
a common way to define the orientation of the three-dimensional coordinate system; when the right hand is curved around the (z)-axis in such a way that the fingers curl from the positive (x)-axis to the positive (y)-axis, the thumb points in the direction of the positive (z)-axis
the eight regions of space created by the coordinate planes
the set of all points equidistant from a given point known as the center
standard equation of a sphere
((x−a)^2+(y−b)^2+(z−c)^2=r^2) describes a sphere with center ((a,b,c)) and radius (r)
three-dimensional rectangular coordinate system
a coordinate system defined by three lines that intersect at right angles; every point in space is described by an ordered triple ((x,y,z)) that plots its location relative to the defining axes

MADISON, Wis. , July 31, 2020 /PRNewswire/ -- Trends Exchange details that the New Space Race will be supplanted during the next decade through space infrastructure projects, space distribution, and continued investment in space-based technology applications.

The Boeing Market Outlook projects $2.5 trillion of defense and space opportunities during the next decade.

Space Capital reports a total of $12.1B invested in space companies in Q1 & Q2 2020, with $303M of that being allocated to early-stage investments.

We often take for granted that space investments are more than moonshot projects to Mars and self-landing rocket capsules. Let's not forget that space investment brought us GPS. And without GPS, we don't get Uber, Google Maps, or Pokémon Go. Not to mention how critical GPS is proving to be in healthcare. – Correll Lashbrook , Lashbrook Growth Fund

SpaceX's Starlink project is working to create a global satellite Internet with more than 42,000 low-orbit satellites – providing rural and underdeveloped areas with high-speed Internet.

Similarly, SpaceMobile is creating an ultra-powerful network that will provide mobile connectivity at 4G/5G speeds everywhere on the planet – land, sea, and in flight.

How does the global market change when we can live-stream the entire summit of Mt. Everest and rural farmers in Chile can participate in Internet commerce?

Commercial satellite imaging is another accelerating area of space investment. Companies such as Picterra, Planet Labs, and SkyWatch provide platforms where anyone can access and train their own AI to detect objects and patterns on satellite imagery. Quite literally, a parking lot owner can count the number of cars in their lot from space.

Space Capital reports that since 2004, more than 862 space companies have received funding, with about 85% of the investment dollars coming in the past 6 years.

We're amidst the New Space Race. And this time the commercial impact will be felt everywhere.

On Thursday, August 6th at 1:30 pm EST , Trends Exchange is hosting a Virtual Happy Hour for Space Angels' 2020 State of the Industry Call.

Trends Exchange and Correll Lashbrook are providing commentary on the macro trends in the space industry, Q2 market signals, key industry developments & milestones, and key insights from Space Angels.

Here's an answer without using symbols.

The difference is precisely that between location and displacement.

  • Points are locations in space.
  • Vectors are displacements in space.

An analogy with time works well.

  • Times, (also called instants or datetimes) are locations in time.
  • Durations are displacements in time.
  • 4:00 p.m., noon, midnight, 12:20, 23:11, etc. are times
  • +3 hours, -2.5 hours, +17 seconds, etc., are durations

Notice how durations can be positive or negative this gives them "direction" in addition to their pure scalar value. Now the best way to mentally distinguish times and durations is by the operations they support

  • Given a time, you can add a duration to get a new time (3:00 + 2 hours = 5:00)
  • You can subtract two times to get a duration (7:00 - 1:00 = 6 hours)
  • You can add two durations (3 hrs, 20 min + 6 hrs, 50 min = 10 hrs, 10 min)

But you cannot add two times (3:15 a.m. + noon = . )

Let's carry the analogy over to now talk about space:

  • $(3,5)$ , $(-2.25,7)$ , $(0,-1)$ , etc. are points
  • $langle 4,-5 angle$ is a vector, meaning 4 units east then 5 south, assuming north is up (sorry residents of southern hemisphere)

Now we have exactly the same analogous operations in space as we did with time:

  • You can add a point and a vector: Starting at $(4,5)$ and going $langle -1,3 angle$ takes you to the point $(3,8)$
  • You can subtract two points to get the displacement between them: $(10,10) - (3,1) = langle 7,9 angle$ , which is the displacement you would take from the second location to get to the first
  • You can add two displacements to get a compound displacement: $langle 1,3 angle + langle -5,8 angle = langle -4,11 angle$ . That is, going 1 step north and 3 east, THEN going 5 south and 8 east is the same thing and just going 4 south and 11 east.

But you cannot add two points.

In more concrete terms: Moscow + $langle ext<200 km north, 7000 km west> angle$ is another location (point) somewhere on earth. But Moscow + Los Angeles makes no sense.

To summarize, a location is where (or when) you are, and a displacement is how to get from one location to another. Displacements have both magnitude (how far to go) and a direction (which in time, a one-dimensional space, is simply positive or negative). In space, locations are points and displacements are vectors. In time, locations are (points in) time, a.k.a. instants and displacements are durations.

EDIT 1: In response to some of the comments, I should point out that 4:00 p.m. is NOT a displacement, but "+4 hours" and "-7 hours" are. Sure you can get to 4:00 p.m. (an instant) by adding the displacement "+16 hours" to the instant midnight. You can also get to 4:00 p.m. by adding the diplacement "-3 hours" to 7:00 p.m. The source of the confusion between locations and displacements is that people mentally work in coordinate systems relative to some origin (whether $(0,0)$ or "midnight" or similar) and both of these concepts are represented as coordinates. I guess that was the point of the question.

EDIT 2: I added some text to make clear that durations actually have direction I had written both -2.5 hours and +3 hours earlier, but some might have missed that the negative encapsulated a direction, and felt that a duration is "only a scalar" when in fact the adding of a $ or $-$ really does give it direction.

EDIT 3: A summary in table form:

Points and vectors are not the same thing. Given two points in 3D space, we can make a vector from the first point to the second. And, given a vector and a point, we can start at the point and "follow" the vector to get another point.

There is a nice fact, however: the points in 3D space (or $mathbb^n$, more generally) are in a very nice correspondence with the vectors that start at the point $(0,0,0)$. Essentially, the idea is that we can represent the vector with its ending point, and no information is lost. This is sometimes called putting the vector in "standard position".

For a course like vector calculus, it is important to keep a good distinction between points and vectors. Points correspond to vectors that start at the origin, but we may need vectors that start at other points.

For example, given three points $A$, $B$, and $C$ in 3D space, we may want to find the equation of the plane that spans them, If we just knew the normal vector $vec n$ of the plane, we could write the equation directly as $vec n cdot (x,y,z) = vec n cdot A$. So we need to find that normal $vec n$. To do that, we compute the cross product of the vectors $vec $ and $vec$. If we computed the cross product of $A$ and $C$ instead (pretending they are vectors in standard position), we could not get the right normal vector.

For example, if $A = (1,0,0)$, $B = (0,1,0)$, and $C = (0,0,1)$, the normal vector of the corresponding plane would not be parallel to any coordinate axis. But if we take any two of $A$, $B$, and $C$ and compute a cross product, we will get a vector parallel to one of the coordinate axes.

In spirit they are different things. But the usual convention is to think of vector in the plane or in three-dimensional space as starting at the origin. In that case, a vector is identified precisely by its ending point, giving you an identification between points and vectors.

One way to see that they are different things (even if identified in many circumstances), is that you can add vectors, while the sum of points makes no sense. Same with the dot and cross products.

What exactly is a vector? You are right that we usually consider a vector as something that has a direction and a magnitude, but there more precise and abstract definition is that a vector in, for example, $mathbb^n$ is just an element of that set. So it is the same as a point when you consider it as an element of a set.

Now if you want to talk about cross products and magnitudes, then it becomes a question about linguistics. The way you, for example, define the magnitude as the function $ lvertcdot vert: mathbb^2 o mathbb $ given for $a = (a_1, a_2) in mathbb^2$ by $ lvert a vert = sqrt. $ So if you insist on talking about the magnitude of a point, then you are "free" to do so (i.e. free to define this). But bare in mind that you will also cause confusion by doing this. And with doing math, we want to communicate clearly and so .

In the same way, you could define the addition or cross product of points.

Maybe it would be better to say this: Is the vector space the same as a set? Yes, a vector space is a set. But it is also more than a set. We can't add elements of a set, but we can add elements of a vector space because with a vector space you get the definition of an addition. So in this sense, a point and vector are very much different.

Added: If you want to find the equation of a plane that contains the three points $a$, $b$, and $c$, then you would not subtract the points. So how do you so it. Well, if the coordinates to point $a$ are $(a_1, a_2, a_3)$, i.e. if $a = (a_1, a_2, a_3)$, (and likewise for $b$ and $c$) then you first define the vectors $ vec = (b_1 - a_1, b_2- a_2, b_3 - a_3) $ and $ vec = (c_1 - a_1, c_2- a_2, c_3 - a_3). $ Then a normal vector for/to the plane is the cross product of the vectors: $vec imes vec$.

This is a question which causes a lot of confusion and it's good that you are trying to clear it up as early as possible. It is clearly a question about the geometric meaning of vectors, so IMHO it is not helpful when people start to involve vector spaces in the discussion.

Let me make the assumption that you know what a point is, and that the confusion begins when vectors are introduced. I don't know how to include diagrams in a post so I must ask you to draw your own. You can visualise a vector as an arrow in the plane (or in $3$-dimensional space, but let's stick with a plane for now). The usual understanding is that a vector is specified by its length and direction, and not by where it is located in the plane. For example, draw an arrow from $(1,-2)$ to $(3,1)$ and another from $(0,2)$ to $(2,5)$. The two arrows have the same length and direction, so they are regarded as the same vector, and it can be written as the vector $(2,5)$, or $2<f i>+5<f j>$ if that's the notation your instructors use.

We often use language a bit loosely and refer to a point as a vector. (It would be more precise to say the point is represented by the vector, but contrary to popular belief mathematicians are not always 100% accurate in how they speak!) In this case we mean the vector from the origin to the stated point. So the first vector drawn above does not represent the point $(3,1)$ since it does not start from the origin. On the other hand, if you draw the arrow from $(0,0)$ to $(2,5)$ then you can see that it is the same vector (that is, has the same length and direction) as the other two. Since it starts from the origin, this vector represents the point $(2,5)$ - as do the other two, since they are the same vector. As you can see, a vector from the origin and the point it represents are the same numerically, but they are different conceptually and it's worth spending some time trying to get your head around it.

Another example - if you haven't seen this yet I expect you soon will. The equation of a line can be written in "parametric vector form" as, for example, $<f x>=(1,2)+lambda(3,4)quadhbox$>.$ Here we think of the vector $(1,2)$ as specifying a point on the line and $(3,4)$ as specifying the direction of the line. So it is important that we should draw $(1,2)$ as starting from the origin (please draw it), but it is not important where we draw $(3,4)$, and the easiest way is to draw it starting at $(1,2)$ and going to $(4,6)$. Then you can draw in the line through $(1,2)$ in the direction $(3,4)$, and this is the line specified by the above equation. The notation $<f x>$ will be a variable point on the line, or in other words a variable vector from the origin to the line.


A linear code of length n and rank k is a linear subspace C with dimension k of the vector space F q n _^> where F q _> is the finite field with q elements. Such a code is called a q-ary code. If q = 2 or q = 3, the code is described as a binary code, or a ternary code respectively. The vectors in C are called codewords. The size of a code is the number of codewords and equals q k .

The weight of a codeword is the number of its elements that are nonzero and the distance between two codewords is the Hamming distance between them, that is, the number of elements in which they differ. The distance d of the linear code is the minimum weight of its nonzero codewords, or equivalently, the minimum distance between distinct codewords. A linear code of length n, dimension k, and distance d is called an [n,k,d] code.

We want to give F q n _^> the standard basis because each coordinate represents a "bit" that is transmitted across a "noisy channel" with some small probability of transmission error (a binary symmetric channel). If some other basis is used then this model cannot be used and the Hamming metric does not measure the number of errors in transmission, as we want it to.

Linearity guarantees that the minimum Hamming distance d between a codeword c0 and any of the other codewords cc0 is independent of c0. This follows from the property that the difference cc0 of two codewords in C is also a codeword (i.e., an element of the subspace C), and the property that d(c, c0) = d(cc0, 0). These properties imply that

In other words, in order to find out the minimum distance between the codewords of a linear code, one would only need to look at the non-zero codewords. The non-zero codeword with the smallest weight has then the minimum distance to the zero codeword, and hence determines the minimum distance of the code.

The distance d of a linear code C also equals the minimum number of linearly dependent columns of the check matrix H.

Example : The linear block code with the following generator matrix and parity check matrix is a [ 7 , 4 , 3 ] 2 > Hamming code.

2 Answers 2

I don't know what zeroes have got to do with it.

Two vectors will always fill a plane unless one is a multiple of the other.

Three vectors will usually fill $R^3$, but you need to watch out for one of the vectors being a linear combination of the others. Given vectors $u$, $v$ and $w$, you need to check that there are no scalars $a$ and $b$ such that $w=au+bv$. If that is the case, then you only have two independent vectors and they fill a plane. Of course, if all three are multiples of each other then you just have a line.

A. It will fill a plane because $v e ku$.

B. They're not all multiples of each other, so not a line.

Gives equations $2a=2$, $2b=2$, $2b=3$.

These are not consistent, so $w$ is not a linear combination of $u$ and $v$, so they fill $R^3$

For part A, it’s just the opposite: each vector contributes something that the other doesn’t, so together they fill a plane.

In part B you’ve got the same situation with the vectors $u$ and $v$—each makes an independent contribution to the whole. Now, does $w$ also make its own contribution, i.e., is it linearly independent of the other two vectors? Any linear combination of $u$ and $v$ must have the same value for the last two coordinates, but that’s not the case for $w$, so mixing in a multiple of $w$ will vary the last coordinate and the three vectors fill the entire space.

More generrally, it’s not so much how many of the coordinates are affected by the given vectors as it is how many will vary independently of each other. For example, multiples of a single vector will in general affect all of the coordinates, but they will vary in lock-step with each other, so you’ll only get a line that way.


A smooth manifold is a mathematical object which looks locally like a smooth deformation of Euclidean space R n : for example a smooth curve or surface looks locally like a smooth deformation of a line or a plane. Smooth functions and vector fields can be defined on manifolds, just as they can on Euclidean space, and scalar functions on manifolds can be differentiated in a natural way. However, differentiation of vector fields is less straightforward: this is a simple matter in Euclidean space, because the tangent space of based vectors at a point p can be identified naturally (by translation) with the tangent space at a nearby point q . On a general manifold, there is no such natural identification between nearby tangent spaces, and so tangent vectors at nearby points cannot be compared in a well-defined way. The notion of an affine connection was introduced to remedy this problem by connecting nearby tangent spaces. The origins of this idea can be traced back to two main sources: surface theory and tensor calculus.

Motivation from surface theory Edit

Consider a smooth surface S in 3-dimensional Euclidean space. Near to any point, S can be approximated by its tangent plane at that point, which is an affine subspace of Euclidean space. Differential geometers in the 19th century were interested in the notion of development in which one surface was rolled along another, without slipping or twisting. In particular, the tangent plane to a point of S can be rolled on S : this should be easy to imagine when S is a surface like the 2-sphere, which is the smooth boundary of a convex region. As the tangent plane is rolled on S , the point of contact traces out a curve on S . Conversely, given a curve on S , the tangent plane can be rolled along that curve. This provides a way to identify the tangent planes at different points along the curve: in particular, a tangent vector in the tangent space at one point on the curve is identified with a unique tangent vector at any other point on the curve. These identifications are always given by affine transformations from one tangent plane to another.

This notion of parallel transport of tangent vectors, by affine transformations, along a curve has a characteristic feature: the point of contact of the tangent plane with the surface always moves with the curve under parallel translation (i.e., as the tangent plane is rolled along the surface, the point of contact moves). This generic condition is characteristic of Cartan connections. In more modern approaches, the point of contact is viewed as the origin in the tangent plane (which is then a vector space), and the movement of the origin is corrected by a translation, so that parallel transport is linear, rather than affine.

In the point of view of Cartan connections, however, the affine subspaces of Euclidean space are model surfaces — they are the simplest surfaces in Euclidean 3-space, and are homogeneous under the affine group of the plane — and every smooth surface has a unique model surface tangent to it at each point. These model surfaces are Klein geometries in the sense of Felix Klein's Erlangen programme. More generally, an n -dimensional affine space is a Klein geometry for the affine group Aff(n) , the stabilizer of a point being the general linear group GL(n) . An affine n -manifold is then a manifold which looks infinitesimally like n -dimensional affine space.

Motivation from tensor calculus Edit

The second motivation for affine connections comes from the notion of a covariant derivative of vector fields. Before the advent of coordinate-independent methods, it was necessary to work with vector fields by embedding their respective Euclidean vectors into an atlas. These components can be differentiated, but the derivatives do not transform in a manageable way under changes of coordinates. [ citation needed ] Correction terms were introduced by Elwin Bruno Christoffel (following ideas of Bernhard Riemann) in the 1870s so that the (corrected) derivative of one vector field along another transformed covariantly under coordinate transformations — these correction terms subsequently came to be known as Christoffel symbols.

This idea was developed into the theory of absolute differential calculus (now known as tensor calculus) by Gregorio Ricci-Curbastro and his student Tullio Levi-Civita between 1880 and the turn of the 20th century.

Tensor calculus really came to life, however, with the advent of Albert Einstein's theory of general relativity in 1915. A few years after this, Levi-Civita formalized the unique connection associated to a Riemannian metric, now known as the Levi-Civita connection. More general affine connections were then studied around 1920, by Hermann Weyl, [4] who developed a detailed mathematical foundation for general relativity, and Élie Cartan, [5] who made the link with the geometrical ideas coming from surface theory.

Approaches Edit

The complex history has led to the development of widely varying approaches to and generalizations of the affine connection concept.

The most popular approach is probably the definition motivated by covariant derivatives. On the one hand, the ideas of Weyl were taken up by physicists in the form of gauge theory and gauge covariant derivatives. On the other hand, the notion of covariant differentiation was abstracted by Jean-Louis Koszul, who defined (linear or Koszul) connections on vector bundles. In this language, an affine connection is simply a covariant derivative or (linear) connection on the tangent bundle.

However, this approach does not explain the geometry behind affine connections nor how they acquired their name. [b] The term really has its origins in the identification of tangent spaces in Euclidean space by translation: this property means that Euclidean n -space is an affine space. (Alternatively, Euclidean space is a principal homogeneous space or torsor under the group of translations, which is a subgroup of the affine group.) As mentioned in the introduction, there are several ways to make this precise: one uses the fact that an affine connection defines a notion of parallel transport of vector fields along a curve. This also defines a parallel transport on the frame bundle. Infinitesimal parallel transport in the frame bundle yields another description of an affine connection, either as a Cartan connection for the affine group Aff(n) or as a principal GL(n) connection on the frame bundle.

Let M be a smooth manifold and let Γ(TM) be the space of vector fields on M , that is, the space of smooth sections of the tangent bundle TM . Then an affine connection on M is a bilinear map

such that for all f in the set of smooth functions on M , written C ∞ (M, R) , and all vector fields X, Y on M :


The concept of tensor product generalizes the idea of forming tensors from vectors using the outer product, which is an operation that can be defined in finite-dimensional vector spaces using matrices: given two vectors v ∈ V in V> and w ∈ W in W> written in terms of components, i.e.

their outer or Kronecker product is given by

The matrix formed this way corresponds naturally to a tensor, where such is understood as a multilinear functional, by sandwiching it with matrix multiplication between a vector and its dual, or transpose:

It is important to note that the tensor, as written, takes two dual vectors - this is an important point that will be dealt with later. In the case of finite dimensions, there is not a strong distinction between a space and its dual, however, it does matter in infinite dimensions and, moreover, getting the regular-vs-dual part right is essential to ensuring that the idea of tensors being developed here corresponds correctly to other senses in which they are viewed, such as in terms of transformations, which is common in physics.

The tensors constructed this way generate a vector space themselves when we add and scale them in the natural componentwise fashion and, in fact, all multilinear functionals of the type given can be written as some sum of outer products, which we may call pure tensors or simple tensors. This is sufficient to define the tensor product when we can write vectors and transformations in terms of matrices, however, to get a fully general operation, a more abstract approach will be required. Especially, we would like to isolate the "essential features" of the tensor product without having to specify a particular basis for its construction, and that is what we will do in the following sections.

To achieve that aim, the most natural way to proceed is to try and isolate an essential characterizing property which will describe, out of all possible vector spaces we could build from V and W, the one which (up to isomorphism) is their tensor product, and which will apply without consideration of any arbitrary choices such as a choice of basis. And the way to do this is to flip the tensor concept "inside out" - instead of viewing the tensors as an object which acts upon vectors in the manner of a bilinear map, we will view them instead as objects to be acted upon to produce a bilinear map. The trick is in recognizing that the Kronecker product "preserves all the information" regarding which vectors went into it: the ratios of vector components can be derived from

12.1: Vectors in Space

In this section we need to take a look at the equation of a line in (^3>). As we saw in the previous section the equation (y = mx + b) does not describe a line in (^3>), instead it describes a plane. This doesn’t mean however that we can’t write down an equation for a line in 3-D space. We’re just going to need a new way of writing down the equation of a curve.

So, before we get into the equations of lines we first need to briefly look at vector functions. We’re going to take a more in depth look at vector functions later. At this point all that we need to worry about is notational issues and how they can be used to give the equation of a curve.

The best way to get an idea of what a vector function is and what its graph looks like is to look at an example. So, consider the following vector function.

[vec rleft( t ight) = leftlangle ight angle ]

A vector function is a function that takes one or more variables, one in this case, and returns a vector. Note as well that a vector function can be a function of two or more variables. However, in those cases the graph may no longer be a curve in space.

The vector that the function gives can be a vector in whatever dimension we need it to be. In the example above it returns a vector in (^2>). When we get to the real subject of this section, equations of lines, we’ll be using a vector function that returns a vector in (^3>)

Now, we want to determine the graph of the vector function above. In order to find the graph of our function we’ll think of the vector that the vector function returns as a position vector for points on the graph. Recall that a position vector, say (vec v = leftlangle ight angle ), is a vector that starts at the origin and ends at the point (left( ight)).

So, to get the graph of a vector function all we need to do is plug in some values of the variable and then plot the point that corresponds to each position vector we get out of the function and play connect the dots. Here are some evaluations for our example.

[vec rleft( < - 3> ight) = leftlangle < - 3,1> ight angle hspace<0.25in>hspace<0.25in>vec rleft( < - 1> ight) = leftlangle < - 1,1> ight angle hspace<0.25in>hspace<0.25in>vec rleft( 2 ight) = leftlangle <2,1> ight angle hspace<0.25in>hspace<0.25in>vec rleft( 5 ight) = leftlangle <5,1> ight angle ]

So, each of these are position vectors representing points on the graph of our vector function. The points,

are all points that lie on the graph of our vector function.

If we do some more evaluations and plot all the points we get the following sketch.

In this sketch we’ve included the position vector (in gray and dashed) for several evaluations as well as the (t) (above each point) we used for each evaluation. It looks like, in this case the graph of the vector equation is in fact the line (y = 1).

Here’s another quick example. Here is the graph of (vec rleft( t ight) = leftlangle <6cos t,3sin t> ight angle ).

In this case we get an ellipse. It is important to not come away from this section with the idea that vector functions only graph out lines. We’ll be looking at lines in this section, but the graphs of vector functions do not have to be lines as the example above shows.

We’ll leave this brief discussion of vector functions with another way to think of the graph of a vector function. Imagine that a pencil/pen is attached to the end of the position vector and as we increase the variable the resulting position vector moves and as it moves the pencil/pen on the end sketches out the curve for the vector function.

Okay, we now need to move into the actual topic of this section. We want to write down the equation of a line in (^3>) and as suggested by the work above we will need a vector function to do this. To see how we’re going to do this let’s think about what we need to write down the equation of a line in (^2>). In two dimensions we need the slope ((m)) and a point that was on the line in order to write down the equation.

In (^3>) that is still all that we need except in this case the “slope” won’t be a simple number as it was in two dimensions. In this case we will need to acknowledge that a line can have a three dimensional slope. So, we need something that will allow us to describe a direction that is potentially in three dimensions. We already have a quantity that will do this for us. Vectors give directions and can be three dimensional objects.

So, let’s start with the following information. Suppose that we know a point that is on the line, ( = left( <,,> ight)), and that (vec v = leftlangle ight angle ) is some vector that is parallel to the line. Note, in all likelihood, (vec v) will not be on the line itself. We only need (vec v) to be parallel to the line. Finally, let (P = left( ight)) be any point on the line.

Now, since our “slope” is a vector let’s also represent the two points on the line as vectors. We’ll do this with position vectors. So, let (overrightarrow <> ) and (vec r) be the position vectors for P0 and (P) respectively. Also, for no apparent reason, let’s define (vec a) to be the vector with representation (overrightarrow <P> ).

We now have the following sketch with all these points and vectors on it.

Now, we’ve shown the parallel vector, (vec v), as a position vector but it doesn’t need to be a position vector. It can be anywhere, a position vector, on the line or off the line, it just needs to be parallel to the line.

Next, notice that we can write (vec r) as follows,

[vec r = overrightarrow <> + vec a]

If you’re not sure about this go back and check out the sketch for vector addition in the vector arithmetic section. Now, notice that the vectors (vec a) and (vec v) are parallel. Therefore there is a number, (t), such that

This is called the vector form of the equation of a line. The only part of this equation that is not known is the (t). Notice that (t,vec v) will be a vector that lies along the line and it tells us how far from the original point that we should move. If (t) is positive we move away from the original point in the direction of (vec v) (right in our sketch) and if (t) is negative we move away from the original point in the opposite direction of (vec v) (left in our sketch). As (t) varies over all possible values we will completely cover the line. The following sketch shows this dependence on (t) of our sketch.

There are several other forms of the equation of a line. To get the first alternate form let’s start with the vector form and do a slight rewrite.

[eginvec r & = leftlangle <,,> ight angle + tleftlangle ight angle leftlangle ight angle & = leftlangle <+ ta, + tb, + tc> ight angle end]

The only way for two vectors to be equal is for the components to be equal. In other words,

This set of equations is called the parametric form of the equation of a line. Notice as well that this is really nothing more than an extension of the parametric equations we’ve seen previously. The only difference is that we are now working in three dimensions instead of two dimensions.

To get a point on the line all we do is pick a (t) and plug into either form of the line. In the vector form of the line we get a position vector for the point and in the parametric form we get the actual coordinates of the point.

There is one more form of the line that we want to look at. If we assume that (a), (b), and (c) are all non-zero numbers we can solve each of the equations in the parametric form of the line for (t). We can then set all of them equal to each other since (t) will be the same number in each. Doing this gives the following,

This is called the symmetric equations of the line.

If one of (a), (b), or (c) does happen to be zero we can still write down the symmetric equations. To see this let’s suppose that ­(b = 0). In this case (t) will not exist in the parametric equation for (y) and so we will only solve the parametric equations for (x) and (z) for (t). We then set those equal and acknowledge the parametric equation for (y) as follows,

Let’s take a look at an example.

To do this we need the vector (vec v) that will be parallel to the line. This can be any vector as long as it’s parallel to the line. In general, (vec v) won’t lie on the line itself. However, in this case it will. All we need to do is let (vec v) be the vector that starts at the second point and ends at the first point. Since these two points are on the line the vector between them will also lie on the line and will hence be parallel to the line. So,

[vec v = leftlangle <1, - 5,6> ight angle ]

Note that the order of the points was chosen to reduce the number of minus signs in the vector. We could just have easily gone the other way.

Once we’ve got (vec v) there really isn’t anything else to do. To use the vector form we’ll need a point on the line. We’ve got two and so we can use either one. We’ll use the first point. Here is the vector form of the line.

[vec r = leftlangle <2, - 1,3> ight angle + tleftlangle <1, - 5,6> ight angle = leftlangle <2 + t, - 1 - 5t,3 + 6t> ight angle ]

Once we have this equation the other two forms follow. Here are the parametric equations of the line.

[eginx & = 2 + t y & = - 1 - 5t z & = 3 + 6tend]

Here is the symmetric form.

To answer this we will first need to write down the equation of the line. We know a point on the line and just need a parallel vector. We know that the new line must be parallel to the line given by the parametric equations in the problem statement. That means that any vector that is parallel to the given line must also be parallel to the new line.

Now recall that in the parametric form of the line the numbers multiplied by (t) are the components of the vector that is parallel to the line. Therefore, the vector,

[vec v = leftlangle <3,12, - 1> ight angle ]

is parallel to the given line and so must also be parallel to the new line.

The equation of new line is then,

[vec r = leftlangle <0, - 3,8> ight angle + tleftlangle <3,12, - 1> ight angle = leftlangle <3t, - 3 + 12t,8 - t> ight angle ]

If this line passes through the (xz)-plane then we know that the (y)-coordinate of that point must be zero. So, let’s set the (y) component of the equation equal to zero and see if we can solve for (t). If we can, this will give the value of (t) for which the point will pass through the (xz)-plane.

[ - 3 + 12t = 0hspace <0.5in>Rightarrow hspace<0.5in>t = frac<1><4>]

So, the line does pass through the (xz)-plane. To get the complete coordinates of the point all we need to do is plug (t = frac<1><4>) into any of the equations. We’ll use the vector form.

[vec r = leftlangle <3left( <4>> ight), - 3 + 12left( <4>> ight),8 - frac<1><4>> ight angle = leftlangle <4>,0,frac<<31>><4>> ight angle ]

Recall that this vector is the position vector for the point on the line and so the coordinates of the point where the line will pass through the (xz)-plane are (left( <4>,0,frac<<31>><4>> ight)).

Blanks and lengths: Understanding SAS/IML character vectors

SAS programmers are probably familiar with how SAS stores a character variable in a data set, but how is a character vector stored in the SAS/IML language?

Recall that a character variable is stored by using a fixed-width storage structure. In the SAS DATA step, the maximum number of characters that can be stored in a variable is determined when the variable is initialized, or you can use the LENGTH statement to specify the maximum number of characters. For example, the following statement specifies that the NAME variable can store up to 10 characters:

The values in a character variable are left aligned. That is, values that have fewer than 10 characters are padded on the right with blanks (space characters).

SAS/IML character vectors

The same rules apply to character vectors in the SAS/IML language. A vector has a "length" that determines the maximum number of characters that can be stored in any element. (In this article, "length" means the maximum number of characters, not the number of elements in a vector.) Elements with fewer characters are blank-padded on the right. Consequently, the following two character vectors are equivalent. :

You can determine the maximum number of characters that can be stored in each element by using the NLENG function in SAS/IML. You can also discover the number of characters in each element of a vector (omitting any blank padding) by using the LENGTH function, as follows:

In this example, each element of the vector c can hold up to six characters. If you write the c variable to a SAS data set, the corresponding variable will have length 6. However, if you trim off the blanks at the end of the strings, most elements have fewer than six characters. Notice that the LENGTH function counts blanks at the beginning and the middle of a string but not at the end, so that the string " XZ" counts as four characters.

Where are the blanks?

Notice that the ODS HTML destination is not ideal for visualizing blanks in strings. In HTML, multiple blank characters are compressed into a single blank when the string is rendered, so only one space appears on the displayed output. If you need to view the spaces in the strings, use the ODS LISTING destination, which uses a fixed-width font that preserves spaces. Alternatively, the following SAS/IML function prints each character (not including trailing blanks):

I think the Str2Vec function is very cool. It uses a feature of the SUBSTR function in SAS/IML 12.1 to convert a string into a vector of characters. The PrintChars function simply calls the Str2Vec function for each element of a character matrix and prints the characters with a column header. This makes it easy to see each character's position in a string.

This article provides a short overview of how strings are stored inside SAS/IML character vectors. For more details about SAS/IML character vectors and how you can manipulate strings, see Chapter 2 of Statistical Programming with SAS/IML Software.

About Author

Rick Wicklin, PhD, is a distinguished researcher in computational statistics at SAS and is a principal developer of SAS/IML software. His areas of expertise include computational statistics, simulation, statistical graphics, and modern methods in statistical data analysis. Rick is author of the books Statistical Programming with SAS/IML Software and Simulating Data with SAS.


How does this change when using multibyte characters, particularly UTF-8, in which characters have different widths? This is an important consideration in almost all languages other than English. Modern software should never be written with the assumption that a character uses one byte.

You are correct, this blog post was written for English text. SAS supports many functions for DBCS and MBCS. For multi-byte characters, the same general ideas of concatenation apply, but you need to use "K functions" such as the KSUBSTR function to query and manipulate strings.

The SSM Procedure (Experimental)

The (linear) state space model is described in the literature in a few different ways and with varying degree of generality. The description given in this section loosely follows the description given in Durbin and Koopman (2001, chap. 6, sec. 4). This formulation of SSM is quite general in particular, it includes nonstationary SSMs with time-varying system matrices and state equations with a diffuse initial condition (these terms are defined later in this subsection).

Suppose that observations are collected in a sequential fashion (indexed by a numeric variable ) on some variables: the vector , which denotes the -variate response values, and the -dimensional vector , which denotes the predictors. Suppose that the observation instances are . The possibility that multiple observations are taken at a particular instance is not ruled out, and the successive observation instances do not need to be regularly spaced—that is, does not need to equal . For , suppose ( ) denotes the number of observations recorded at instance . For notational simplicity, an integer-valued secondary index is used to index the data so that corresponds to , corresponds to , and so on. Consider the following model:

The following list describes these equations:

The observation equation describes the relationship between the -dimensional response vector and the unobserved vectors , , and . The -variate responses are vertically stacked in a column to form this -dimensional response vector . The -dimensional vectors are called states , the -dimensional vector is the regression coefficient vector associated with predictors , and the -dimensional vectors are called the observation disturbances . The matrices (of dimension ) and (of dimension ) correspond to the state effect and the regression effect , respectively. The elements of are assumed to be fully known. The states and the disturbances are random sequences. It is assumed that is a sequence of independent, zero-mean, Gaussian random vectors with diagonal covariances, with the diagonal elements denoted by .

The state sequence is assumed to follow a Markovian structure described by the state transition equation and the associated initial condition.

The state transition equation postulates that a new instance of the state, , is obtained by multiplying its previous instance, , by an -dimensional square matrix (called the state transition matrix) and by adding two vectors: a known nonrandom vector (called the state input) and a random disturbance vector . The -dimensional state disturbance vectors are assumed to be independent, zero-mean, Gaussian random vectors with covariances (not necessarily diagonal).

The initial condition describes the starting condition of the state evolution equation. The starting state vector is assumed to be partially diffuse: it is the sum of a known nonrandom vector , a mean-zero Gaussian vector , and a term that represents the contribution from a -dimensional diffuse vector (a diffuse vector is a Gaussian vector with infinite covariance). The matrix is assumed to be completely known.

The observation disturbances and the state disturbances (for ) are assumed to be mutually independent. Either the elements of the matrices , , and and the diagonal elements of the observation disturbance covariances are assumed to be completely known, or some of them can be functions of a small set of unknown parameters (to be estimated from the data). Suppose that this unknown set of parameters is denoted by .

The -dimensional diffuse vector from the state initial condition together with the -dimensional regression coefficient vector constitute the overall -dimensional diffuse initial condition of the model. See the section Likelihood, Filtering, and Smoothing for more information.

Although this description of the state space model might appear involved, it conveniently covers many variants of the SSMs that are encountered in practice and precisely describes the most general case that can be handled by the SSM procedure. An important restriction about the preceding description of the model formulation is that it assumes that the matrices that appear in the observation equation are free of unknown parameters and that the covariances of the observation disturbances are diagonal. In most practical situations, the model under consideration can be easily reformulated to a statistically equivalent form that conforms to this restriction.

For easy reference, Table 27.4 summarizes the information contained in the SSM equations.

Watch the video: Μοναδιαία διανύσματα (December 2021).