n-dimensional vector product (generalization of 3-dimensional vector product, vector algorithm)

Source: Internet
Author: User
Tags mul

In three-dimensional space, the product of two vectors (a vector product, an outer product, a product, a multiplication of multiples of two vectors: the inner product, the dot product) represents the torque of two vectors, and the mixed product axb of three vectors C, the area of the parallelepiped that is composed of three vector a,b,c. And the position of a,b,c in the mixed product is interchangeable (this is easy to prove), which is also in line with our experience. So that's the problem?
1) How is the 3 or n>3 three-dimensional vector multiplication defined? Axbxcxd .... Because AXB is defined, AXB is a vector, so long as you continue to multiply it, it also shows that 3-dimensional vector multiplication, the number of vectors is not a problem;
2) The number of vectors is not a problem, the 4-dimensional vector multiplication of two vectors?

Set A= (A1,A2,A3,A4), b= (B1,B2,B3,B4) a*b= (x1,x2,x3,x4) satisfies the following equations:
①a (a*b) =0
②b (a*b) =0
③| a*b|=| a|*| b|sinθ.
This is a 4-yuan two-time equation group, but only 3 equations, obviously the solution is not one. This shows that a*b in 4-dimensional space, if defined vertically, cannot be uniquely determined, and the result is a polygon.
Similarly, extended to n-dimensional space, the equation group is still only 3. The result is a n-2 dimension (polygon).

The following promotes the n-dimensional vector
N-1 a vector product: a1*a2* ... A (n-1) ·;
Mixed product: a1*a2* ... A (n-1) an.


<summary>///vector product///</summary>//<param name= "A" ></param>// <param name= "B" ></param>///<returns></returns> public static Tvector Mul (Tvector A , Tvector B) {if (A.count = = B.count && B.count = = 3) {var thei = a[                1] * b[2]-a[2] * b[1];                var TheJ =-(a[0] * b[2]-a[2] * b[0]);                var TheK = a[0] * b[1]-a[1] * b[0];                Tvector Thev = new Tvector (thei, TheJ, TheK);            return Thev;            } else {throw new Exception ("Now only supports 3 components."); }}///<summary>///n-1 vector of n-dimensional vectors, n>3///</summary>//<param NA Me= "Vectors" > Vector group </param>//<returns></returns> public static Tvector Mul2 (params Tvec Tor[] Vectors) {if (Vectors==null | | Vectors.leNgth < 2) {throw new Exception ("parameter error must be an n-dimensional vector n-1 vector pattern"); } var then = Vectors[0].            Count;            if (then! = vectors.length + 1) {throw new Exception ("parameter error must be an n-dimensional vector n-1 vector pattern");            } var TheA = new Double[then, then];             for (int i = 0; i < then; i++) {thea[0, i] = 1;                } for (int i = 0, i < then; i++) {for (int j = 0; J < Vectors.length; J + +)                {thea[j + 1, i] = vectors[j][i]; }}//press the first line to expand the algebraic cofactor type and calculate the determinant.            The algebraic cofactor of (1,J) is the value of the first J component of the vector.            var Thereta = new Double[then];                 for (int j = 0; J < then; J + +) {var theA1 = Linearalgebra.getdeterminantmij (TheA, 1, j + 1);                var thesign = linearalgebra.calcdetermijsign (1, j + 1); THERETA[J] = thesign * Linearalgebra.calcdetermiNant (theA1);        } return new Tvector (Thereta); }///<summary>///n vector of n-dimensional mixed product a1xa2 .... An-1 AN///</summary>//<param name= "Vectors" > Vector group </param>//<returns></ret urns> public static double Mul3 (params tvector[] Vectors) {if (Vectors = = NULL | |            Vectors.length < 2) {throw new Exception ("parameter error must be an n-dimensional vector n-1 vector pattern"); } var then = Vectors[0].            Count;            if (then! = vectors.length) {throw new Exception ("parameter error must be n-dimensional vector n vector mode");                      } var TheA = new Double[then, then];                     for (int i = 0, i < Then, i++) {for (int j = 0; J < Vectors.length; J + +) {                Thea[j, I] = vectors[j][i];        }} return Linearalgebra.calcdeterminant (TheA); }//<summary> Vector Mixed Product AXB C//</summary>//<param name= "A" ></param>//<param name= "B" ></param&        Gt <returns></returns> public static double Mul (Tvector A, Tvector B, Tvector C) {i                F (a.count = = B.count && B.count = = 3) {double[,] TheA = new double[3, 3];                    for (int i = 0; i < 2; i++) {thea[0, I] = a[i];                    Thea[1, I] = b[i];                Thea[2, I] = c[i];            } return Linearalgebra.calcdeterminantaij (TheA);            } else {throw new Exception ("Now only supports 3 components."); }        }

For the time being, there is a moment to continue the study. Note: The functions used in the algorithm are described in the Mymathlib series.????

n-dimensional vector product (generalization of 3-dimensional vector product, vector algorithm)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.