Linear Combination Calculator

Multiply two vectors by scalars and add them component by component.

Calculate a linear combination
Enter equally sized vectors as comma-separated values.

About linear combinations

A linear combination is created by multiplying vectors by scalar numbers and adding the resulting vectors. For two vectors v1 and v2 with scalars a and b, the expression is av1 + bv2. This calculator performs that operation component by component. If v1 is (x1, y1, z1) and v2 is (x2, y2, z2), the result is (ax1 + bx2, ay1 + by2, az1 + bz2). The same rule works for vectors of any finite dimension as long as both vectors have the same number of components. Scalars control the size and direction of each contribution. A scalar greater than one stretches a vector, a value between zero and one shrinks it, and a negative scalar reverses its direction. A zero scalar removes that vector from the combination entirely. Because addition is performed by matching positions, a two-dimensional vector cannot be directly combined with a three-dimensional vector. The calculator detects mismatched dimensions and asks for compatible input instead of dropping a component. Linear combinations are central to linear algebra. The span of a collection of vectors is the set of all possible linear combinations of those vectors. A vector belongs to that span when some choice of scalar coefficients reproduces it. Basis vectors are especially useful because every vector in their space can be expressed as a unique linear combination when the basis is linearly independent. Coordinate systems, matrix multiplication, systems of equations, signal mixing, computer graphics, and data models all use this idea. To check a result, multiply every component of the first vector by the first scalar, do the same for the second vector, and add corresponding products. Keep component order consistent throughout the calculation. Decimal and negative values are allowed, and the displayed result is rounded only for readability. For combinations involving more than two vectors, calculate the first two, then use their result as one input in a subsequent calculation with the next vector. This repeated process follows the associative property of vector addition and produces the same final vector.

Examples

Each row applies scalar multiplication before vector addition.

ExpressionResultInterpretation
2(1, 2, 3) - (4, 5, 6)(-2, -1, 0)Subtract the second vector from twice the first.
3(2, -1) + 0.5(4, 6)(8, 0)Both component sums are evaluated separately.
-2(1, 0) + 4(0, 1)(-2, 4)Standard basis vectors set each coordinate.

How to use the calculator

  1. Enter the multiplier for the first vector.
  2. Enter the first vector with components separated by commas.
  3. Enter the second scalar and an equally sized second vector.
  4. Select Calculate combination to add the scaled components.

Frequently asked questions

What is a scalar?

A scalar is an ordinary number that multiplies every component of a vector. It changes the vector's magnitude and may reverse its direction.

Must the vectors have the same dimension?

Yes, vector addition pairs corresponding components. Vectors with different component counts do not have a standard component-wise sum.

Can coefficients be negative or decimal?

Yes, any finite real number can be used as a scalar. Negative values reverse direction, while decimals scale proportionally.

What does a zero coefficient do?

Multiplying a vector by zero produces the zero vector. That vector therefore contributes nothing to the final combination.

How does this relate to span?

The span is the complete set of vectors obtainable from all choices of coefficients. Each result from this calculator is one member of the span of the two inputs.