static public Vecteur3D operator +(Vecteur3D v, Vecteur3D w) //somme vectorielle { Vecteur3D z = v; v.additionner(w); return(z); }
static public Vecteur3D operator *(float f, Vecteur3D v) //produit par un réel { Vecteur3D z = v; z.multiplier_par(f); return(z); }
public Vecteur3D Cross(Vecteur3D w) //produit vectoriel { Vecteur3D z = new Vecteur3D((this.y * w.z) - (w.y * this.z), (this.z * w.x) - (w.z * x), (x * w.y) - (w.x * y) ); return(z); }
static public Vecteur3D operator ^(Vecteur3D v, Vecteur3D w) //produit vectoriel { Vecteur3D z = new Vecteur3D( v.y * w.z - w.y * v.z, v.z * w.x - w.z * v.x, v.x * w.y - w.x * v.y ); return(z); }
public void additionner(Vecteur3D a) { x = x + a.x; y = y + a.y; z = z + a.z; }
float prodscal(Vecteur3D v) { return(x * v.x + y * v.y + z * v.z); }