import java.util.Scanner;

public class Vectores2
{
  public static void main(String args[])
  {
    Scanner teclado = new Scanner (System.in);
    double [] a = new double[2];
    double [] b = new double[2];
    double [] c = new double[2];
    int suma;
    int resta;
    
    
    System.out.print("V1: ");
    double x1 = teclado.nextDouble();
    double y1 = teclado.nextDouble();
    
    System.out.print("V2: ");
    double x2 = teclado.nextDouble();
    double y2 = teclado.nextDouble();
    
    a[0]=x1; 
    a[1]=y1;
    
    b[0]=x2; 
    b[1]=y2;
    
    
    double magnitudvector1;
    double magnitudvector2;
    double angulovector1;
    double angulovector2;
    
    magnitudvector1 = Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2));
    angulovector1= Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2));
    System.out.print("\nV1 (r, a) = " + magnitudvector1 + ", " + angulovector1);
    
    magnitudvector2 = Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2));
    angulovector2= Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2));
    System.out.print("\nV2 (r, a) = " + magnitudvector2 + ", " + angulovector2);
    
    System.out.print("\nV1 + V2: " );
    for(int i=0; i<2; i++)
      c[i]= a[i] + b[i];
    for(int i=0; i<2; i++)
      System.out.print(c[i] + " ");
    
    
    
    System.out.print("\nV1 - V2: " );
    for(int i=0; i<2; i++)
      c[i]= a[i] - b[i];
    for(int i=0; i<2; i++)
      System.out.print(c[i] + " ");
    
    System.out.print("\nV2 - V1: " );
    for(int i=0; i<2; i++)
      c[i]= b[i] - a[i] ;
    for(int i=0; i<2; i++)
      System.out.print(c[i] + ", ");
    
  }
}

