add()
add(mixed $vector1, mixed $vector2) : array
Adds two vectors component-wise. Treat empty components in either array as zero entries. If either vector is in fact a constant then add that constant to each entry
Parameters
mixed | $vector1 | first term vector to add. If is a scalar then add that scalar to all components of other vector |
mixed | $vector2 | second term vector to add. If is a scalar then add that scalar to all components of other vector |
Returns
array —associative array corresponding to component-wise adding these two vectors.