Common Reference > VectorMath Class

## VectorMath Class

This class provides a convenient library of static methods for transforming array data.

`public class VectorMath`

### VectorMath Methods

 Catenate Catenate a vector to another vector (or scalar) Cos Compute the cosine of any vector Difference Compute the first difference of an integer vector Divide Divide two integer vectors Drop Create an integer vector by removing count items from an existing integer vector Enlist Catenate a list of vectors together ExponentialSmooth Simple exponential smooth of existing vector with given smoothing constant Max The largest item in an integer vector Min The smallest item in an integer vector MovingAverage Moving average of an integer vector given period and pad value MovingTotal Moving total of an integer vector given period and pad value Multiply Multiply two integer vectors Negate The negative values of an integer vector Pow Power two double vectors Range Generate indices from start up to end Reciprocal The inverse values of an integer vector RunningMax Running maximum of an integer vector RunningMin Running minimum of an integer vector RunningTotal Running total of an integer vector Sin Compute the sine of any vector Sqrt Square root of an integer vector Subtract Subtract two integer vectors Sum Add two integer vectors Tail Create an integer vector from the last elements of existing integer vector and new element count Take Create an integer vector from an existing integer vector and new element count Total Total of an integer vector

### Example

Typically you may want to combine several variables in a Scatterplot, or draw a timeseries with a moving average.

```BP = new int[] {427,428,427,429,424,418,420,424,416,410,406,409,403,395,389,380,374,369,
356,362,383,383,382,393,386,398,382,379,380,394,385,381,388,396,404,393,400,413,417,
414,402,400,400,408,408,406,405,395,392,395,371,392,400,415,413,414,417,428,416,422,
429,416,414,401,416,406,407,416,421,411,412,406,405,408,414,407,408,414,412,406,395,
403,400,397,395,405,411,414,408};

sp.LineGraphStyle = LineGraphStyles.Markers|LineGraphStyles.NoLines;
sp.SetMarkers(Marker.Dot);

sp.DrawLineGraph(BP);

sp.SetLineStyles(LineStyle.Solid);

sp.LineGraphStyle = 0;
sp.DrawLineGraph(new double[][]{mav12,mav20});```

### Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)