Converts a vector from one dimension to another dimension.