import java.util.Scanner;

public class Examen02
{
  private static int vectornulo = 0;
  private static int vector1 = 0;
  private static int coord1 = 0;
  private static int coord2 = 0;
  
  public static void main(String args[])
  {
    System.out.print("Operaciones con vectores en el plano\n");
    
    while ( leer() )
      imprimirVector();
  }
  public static boolean leer()
  {
    Scanner teclado = new Scanner(System.in);
    
    for (int i = 1; ; i++)
    {
      System.out.println("\nVector" +i);
      
      System.out.println("Coordenada 1: ");
      coord1 = teclado.nextInt();
      if ( coord1 == 0 ) return false;
      System.out.println("Coordenada 2: ");
      coord2 = teclado.nextInt();
      if ( coord1 == 0 ) return false;
      
      return true;
    }
    
  }
  
  public static void imprimirVector()
  {
    System.out.println("V1: (x,y) = (" +coord1 +" " +coord2 +")" +"; (r,ang) = " +calcularDistancia(coord1, coord2) +";" +calcularAngulo(coord1,coord2));
  }
  
  public static double calcularDistancia(double coord1 , double coord2)
  {
    double d = Math.sqrt((coord1 * coord1) + (coord2 * coord2));
    return d;
  }
  
  public static double calcularAngulo(double coord1 , double coord2)
  {
    double A = Math.atan(coord2 / coord1);
    return A;
  }
  
  
}

