Beispiel #1
0
        public void cisailleYZ(double s, double t)
        {
            Vecteur3 l1 = new Vecteur3(1, s, t);
            Vecteur3 l2 = new Vecteur3(0, 1, 0);
            Vecteur3 l3 = new Vecteur3(0, 0, 1);
            Matrice  m  = new Matrice(l1, l2, l3); //Création matrice de cisaillement

            this.multiply(m);                      //Application du cisaillement
        }
Beispiel #2
0
        public Matrice getComatrice()
        {
            Vecteur3 l1 = new Vecteur3(this.getCofacteur(1, 1), this.getCofacteur(1, 2), this.getCofacteur(1, 3));
            Vecteur3 l2 = new Vecteur3(this.getCofacteur(2, 1), this.getCofacteur(2, 2), this.getCofacteur(2, 3));
            Vecteur3 l3 = new Vecteur3(this.getCofacteur(3, 1), this.getCofacteur(3, 2), this.getCofacteur(3, 3));
            Matrice  m  = new Matrice(l1, l2, l3);

            return(m.transpose());
        }
Beispiel #3
0
        public void projectionN(Vecteur3 n)
        {
            Vecteur3 l1 = new Vecteur3(1 - n.x * n.x, -n.x * n.y, -n.x * n.z);
            Vecteur3 l2 = new Vecteur3(-n.x * n.y, 1 - n.y * n.y, -n.y * n.z);
            Vecteur3 l3 = new Vecteur3(-n.x * n.z, -n.z * n.y, 1 - n.z * n.z);
            Matrice  m  = new Matrice(l1, l2, l3); //Matrice de projection celon n

            this.multiply(m);                      //Application de la projection
        }
Beispiel #4
0
        public void reflexion(Vecteur3 n)
        {
            Vecteur3 l1 = new Vecteur3(1 - 2 * n.x * n.x, -2 * n.x * n.y, -2 * n.x * n.z);
            Vecteur3 l2 = new Vecteur3(-2 * n.x * n.y, 1 - 2 * n.y * n.y, -2 * n.y * n.z);
            Vecteur3 l3 = new Vecteur3(-2 * n.x * n.z, -2 * n.y * n.z, 1 - 2 * n.z * n.z);
            Matrice  m  = new Matrice(l1, l2, l3); //Création de la matrice de réflexion

            this.multiply(m);                      //Application de la reflexion
        }
Beispiel #5
0
        public void rotateZ(double angle)
        {
            //Création matrice de rotation
            Vecteur3 l1            = new Vecteur3(Math.Cos(angle), Math.Sin(angle), 0);
            Vecteur3 l2            = new Vecteur3(-Math.Sin(angle), Math.Cos(angle), 0);
            Vecteur3 l3            = new Vecteur3(0, 0, 1);
            Matrice  rotateMatrice = new Matrice(l1, l2, l3);

            //rotation
            this.multiply(rotateMatrice);
        }
Beispiel #6
0
        public Matrice transpose()
        {
            Matrice  res   = new Matrice();
            Vecteur3 resL1 = new Vecteur3(this.l1.x, this.l2.x, this.l3.x);             //Création des valeurs transposées à chaque ligne de la matrice
            Vecteur3 resL2 = new Vecteur3(this.l1.y, this.l2.y, this.l3.y);
            Vecteur3 resL3 = new Vecteur3(this.l1.z, this.l2.z, this.l3.z);

            res.l1 = resL1;
            res.l2 = resL2;
            res.l3 = resL3;
            return(res);
        }
Beispiel #7
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Test vecteurs");

            Vecteur3 v1 = new Vecteur3(1, 2, 3);
            Vecteur3 v2 = new Vecteur3(-2, 5, 6);
            Vecteur3 v3 = new Vecteur3(-3, -6, 1);

            Vecteur3 v4 = new Vecteur3(1.0 / 9.0, 8.0 / 9.0, (-4.0 / 9.0));
            Vecteur3 v5 = new Vecteur3(4.0 / 9.0, -4.0 / 9.0, -7.0 / 9.0);
            Vecteur3 v6 = new Vecteur3(8.0 / 9.0, 1.0 / 9.0, 4.0 / 9.0);
        }
Beispiel #8
0
        public void scaleN(Vecteur3 n, double k)
        {
            Vecteur3 l1 = new Vecteur3(1 + (k - 1) * n.x * n.x,
                                       (k - 1) * n.x * n.y,
                                       (k - 1) * n.x * n.z);
            Vecteur3 l2 = new Vecteur3((k - 1) * n.x * n.y,
                                       1 + (k - 1) * n.y * n.y,
                                       (k - 1) * n.y * n.z);
            Vecteur3 l3 = new Vecteur3((k - 1) * n.z * n.x,
                                       (k - 1) * n.z * n.y,
                                       1 + (k - 1) * n.z * n.z);
            Matrice m = new Matrice(l1, l2, l3); //Création matrice scale

            this.multiply(m);                    //Application du scale
        }
Beispiel #9
0
        public void rotateN(Vecteur3 n, double angle)
        {
            Vecteur3 l1 = new Vecteur3(n.x * n.x * (1 - Math.Cos(angle)) + Math.Cos(angle),
                                       n.x * n.y * (1 - Math.Cos(angle)) + n.z * Math.Sin(angle),
                                       n.x * n.z * (1 - Math.Cos(angle)) - n.y * Math.Sin(angle));

            Vecteur3 l2 = new Vecteur3(n.x * n.y * (1 - Math.Cos(angle)) - n.z * Math.Sin(angle),
                                       n.y * n.y * (1 - Math.Cos(angle)) + Math.Cos(angle),
                                       n.y * n.z * (1 - Math.Cos(angle)) + n.x * Math.Sin(angle));

            Vecteur3 l3 = new Vecteur3(n.x * n.z * (1 - Math.Cos(angle)) + n.y * Math.Sin(angle),
                                       n.y * n.z * (1 - Math.Cos(angle)) - n.x * Math.Sin(angle),
                                       n.z * n.z * (1 - Math.Cos(angle)) + Math.Cos(angle));
            Matrice m = new Matrice(l1, l2, l3); //Création de la matrice de rotation

            this.multiply(m);                    //On applique la matrice de rotation
        }
Beispiel #10
0
        public void multiply(Matrice m)
        {
            Vecteur3 l1 = new Vecteur3();
            Vecteur3 l2 = new Vecteur3();
            Vecteur3 l3 = new Vecteur3();

            l1.x = this.l1.x * m.l1.x + this.l1.y * m.l2.x + this.l1.z * m.l3.x;
            l1.y = this.l1.x * m.l1.y + this.l1.y * m.l2.y + this.l1.z * m.l3.y;
            l1.z = this.l1.x * m.l1.z + this.l1.y * m.l2.z + this.l1.z * m.l3.z;

            l2.x = this.l2.x * m.l1.x + this.l2.y * m.l2.x + this.l2.z * m.l3.x;
            l2.y = this.l2.x * m.l1.y + this.l2.y * m.l2.y + this.l2.z * m.l3.y;
            l2.z = this.l2.x * m.l1.z + this.l2.y * m.l2.z + this.l2.z * m.l3.z;

            l3.x = this.l3.x * m.l1.x + this.l3.y * m.l2.x + this.l3.z * m.l3.x;
            l3.y = this.l3.x * m.l1.y + this.l3.y * m.l2.y + this.l3.z * m.l3.y;
            l3.z = this.l3.x * m.l1.z + this.l3.y * m.l2.z + this.l3.z * m.l3.z;

            this.l1 = l1;
            this.l2 = l2;
            this.l3 = l3;
        }
 public Matrice43(Vecteur3 l1, Vecteur3 l2, Vecteur3 l3, Vecteur3 l4) : base(l1, l2, l3, l4)
 {
 }