Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author camille
- */
- public class vect
- {
- private int a, b, c;
- private static int nV;
- vect()
- {
- this.a = this.b = this.c = 0;
- nV++;
- }
- vect(int pa, int pb, int pc)
- {
- this.a = pa;
- this.b = pb;
- this.c = pc;
- nV++;
- }
- public static int vectCounter()
- {
- return nV;
- }
- public void multiply(int m)
- {
- this.a = this.a * m;
- this.b = this.b * m;
- this.c = this.c * m;
- }
- public void sum(vect V1, vect V2)
- {
- this.a = V1.a + V2.a;
- this.b = V1.b + V2.b;
- this.c = V1.c + V2.c;
- }
- public void mul(vect V1, vect V2)
- {
- this.a = V1.a * V2.a;
- this.b = V1.b * V2.b;
- this.c = V1.c * V2.c;
- }
- public void display()
- {
- System.out.println("Vecteur 2D");
- System.out.println("a = " + this.a);
- System.out.println("b = " + this.b);
- System.out.println("c = " + this.c);
- }
- public int getA()
- {
- return this.a;
- }
- public int getB()
- {
- return this.b;
- }
- public int getC()
- {
- return this.c;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement