import java.util.Scanner; public class Recta { private double m = 0.0; private double b = 0.0; private static Scanner teclado = new Scanner(System.in); public boolean leer() { System.out.print("m: "); m = teclado.nextDouble(); if ( m == 0.0 ) return false; System.out.print("b: "); b = teclado.nextDouble(); return true; } public String toString() { return "y = " + m + "x + " + b; } public boolean esParalela(Recta otra) { return m == otra.m; } public boolean esPerpendicular(Recta otra) { return m == 1.0 / otra.m; } }