public Form1.TVector MultiplyVector(double s, Form1.TVector V) { Form1.TVector tvector; tvector.x = s * V.x; tvector.y = s * V.y; tvector.z = s * V.z; return(tvector); }
public Form1.TVector CrossProduct(Form1.TVector V1, Form1.TVector V2) { Form1.TVector tvector; tvector.x = V1.y * V2.z - V2.y * V1.z; tvector.y = V1.z * V2.x - V2.z * V1.x; tvector.z = V1.x * V2.y - V2.x * V1.y; return(tvector); }
public Form1.TVector AddVectors(Form1.TVector V1, Form1.TVector V2) { Form1.TVector tvector; tvector.x = V1.x + V2.x; tvector.y = V1.y + V2.y; tvector.z = V1.z + V2.z; return(tvector); }
public Form1.TVector UnitVector(Form1.TVector V) { Form1.TVector tvector; tvector.x = V.x / this.VectorLength(V); tvector.y = V.y / this.VectorLength(V); tvector.z = V.z / this.VectorLength(V); return(tvector); }
public double DotProduct(Form1.TVector V1, Form1.TVector V2) => V1.x * V2.x + V1.y * V2.y + V1.z * V2.z;
public double VectorLength(Form1.TVector V) => Math.Pow(V.x * V.x + V.y * V.y + V.z * V.z, 0.5);
public void ClearWindow() => graph.FillRectangle(Brushes.Black, 0, 0, this.boxCanvas.Width, this.boxCanvas.Height); // window (umin, vmin, umax, vmax) public void SetVector(ref Form1.TVector V, double x, double y, double z) { V.x = x; V.y = y; V.z = z; }