To construct a vector that is perpendicular to another given vector, you can use techniques based on the dotproduct and crossproduct of vectors. The dotproduct of the vectors A = (a1, a2, a3) and B = (b1, b2, b3) is equal to the sum of the products of the corresponding components: A∙B = a1b2 + a2b2 + a3b3. If two vectors are perpendicular, then their dotproduct is equal to zero. The crossproduct of two vectors is defined to be A×B = (a2b3  a3b2, a3b1  a1b3, a1b2  a2*b1). The cross product of two nonparallel vectors is a vector that is perpendicular to both of them.
Two Dimensions  Dot Product

Write down a hypothetical, unknown vector V = (v1, v2).

Calculate the dotproduct of this vector and the given vector. If you are given U = (3,10), then the dot product is V∙U = 3 v1 + 10 v2.

Set the dotproduct equal to 0 and solve for one unknown component in terms of the other: v2 = (3/10) v1.

Pick any value for v1. For instance, let v1 = 1.

Solve for v2: v2 = 0.3. The vector V = (1,0.3) is perpendicular to U = (3,10). If you chose v1 = 1, you would get the vector V’ = (1, 0.3), which points in the opposite direction of the first solution. These are the only two directions in the twodimensional plane perpendicular to the given vector. You can scale the new vector to whatever magnitude you want. For instance, to make it a unit vector with magnitude 1, you would construct W = V/(magnitude of v) = V/(sqrt(10) = (1/sqrt(10), 0.3/sqrt(10).
Three Dimensions  Dot Product

Write down a hypothetical unknown vector V = (v1, v2, v3).

Calculate the dotproduct of this vector and the given vector. If you are given U = (10, 4, 1), then V∙U = 10 v1 + 4 v2  v3.

Set the dotproduct equal to zero. This is the equation for a plane in three dimensions. Any vector in that plane is perpendicular to U. Any set of three numbers that satisfies 10 v1 + 4 v2  v3 = 0 will do.

Choose arbitrary values for v1 and v2, and solve for v3. Let v1 = 1 and v2 = 1. Then v3 = 10 + 4 = 14.

Perform the dotproduct test to show that V is perpendicular to U: By the dotproduct test, the vector V = (1, 1, 14) is perpendicular to the vector U: V∙U = 10 + 4  14 = 0.
Three Dimensions  Cross Product

Choose any arbitrary vector that is not parallel to the given vector. If a vector Y is parallel to a vector X, then Y = a*X for some nonzero constant a. For simplicity, use one of the unit basis vectors, such as X = (1, 0, 0).

Calculate the cross product of X and U, using U = (10, 4, 1): W = X×U = (0, 1, 4).

Check that W is perpendicular to U. W∙U = 0 + 4  4 = 0. Using Y = (0, 1, 0) or Z = (0, 0, 1) would give different perpendicular vectors. They would all lie in the plane defined by the equation 10 v1 + 4 v2  v3 = 0.
References
 Photo Credit robertiez/iStock/Getty Images