using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
static void Main(string[] args)
List<double> a = new List<double>();
double[] bTemp = { 2, 4, 6 };
List<double> b = new List<double>(bTemp);
Vector Va = new Vector(a);
Vector Vb = new Vector(b);
Console.WriteLine("The dimension of the Vector Va is: " + Va.dimension);
Console.WriteLine("Vector Va is: " + Va.ToString());
Console.WriteLine("The dimension of the Vector Vb is:" + Vb.dimension);
Console.WriteLine("Vector Vb is: " + Vb.ToString());
Console.WriteLine("Va+Vb=" + Vc.ToString());
Vector Vd = Vb.subtract(Va);
Console.WriteLine("Vb-Va=" + Vd.ToString());
Vector Ve = Vb.scalarMultiplication(3.00);
Console.WriteLine("3xVb=" + Ve.ToString());
Console.WriteLine("Va.Vb=" + Va.dotProduct(Vb));
double[] cTemp = { 3, 3 };
List<double> c = new List<double>(cTemp);
Vector Vf = new Vector(c);
Console.WriteLine("The dimension of the Vector Vf is:" + Vf.dimension);
Console.WriteLine("Vector Vf is: " + Vf.ToString());
Console.WriteLine("The dimensions of the two vectors do not match");
public List<double> _something;
public Vector(List<double> a)
dimension = _something.Count;
public Vector add(Vector b)
List<double> abc = new List<double>();
for (int i = 0; i != _something.Count; i++)
abc[i] = this._something[i] + b._something[i];
Vector result = new Vector(abc);
public Vector subtract(Vector c)
List<double> abcd = new List<double>();
for(int i=0;i!=_something.Count;i++)
abcd[i] =this._something[i]-c._something[i];
Vector result = new Vector(abcd);
public Vector scalarMultiplication(double d)
List<double> abcde = new List<double>();
for (int i = 0; i != _something.Count; i++)
abcde[i] = this._something[i] * d;
Vector result = new Vector(abcde);
public double dotProduct(Vector e)
List<double> abcdef = new List<double>();
for (int i = 0; i != _something.Count; i++)
abcdef[i] = this._something[i] * e._something[i];
for(int j=0;j!=_something.Count;j++)
for(int i=0;i!=_something.Count;i++)
if(i!=_something.Count-1)
else if(i==_something.Count-1)