示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
 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);
 }
示例#4
0
 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);
 }
示例#5
0
 public double DotProduct(Form1.TVector V1, Form1.TVector V2) => V1.x * V2.x + V1.y * V2.y + V1.z * V2.z;
示例#6
0
 public double VectorLength(Form1.TVector V) => Math.Pow(V.x * V.x + V.y * V.y + V.z * V.z, 0.5);
示例#7
0
        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;
        }