Sie sind auf Seite 1von 1

import java.util.

Scanner;

public class Problema2 {


public static void main(String[] args) {
Scanner t=new Scanner (System.in);
float a, b, c, x, y, x0, y0;
System.out.println("En funci�n de la ecuaci�n general de la recta:
AX+BX+C=0, ingrese:");
System.out.print("A: ");
a=t.nextFloat();
System.out.print("B: ");
b=t.nextFloat();
System.out.print("C: ");
c=t.nextFloat();
System.out.println("Del punto (X,Y): ");
System.out.print("Ingrese X: ");
x= t.nextFloat();
System.out.print("Ingrese Y: ");
y =t.nextFloat();

y0=(-c - a*x)/b;

if(y>y0){
System.out.println("est� sobre la recta");
}else System.out.println("est� debajo de la recta");

if(x>0){
if(y>0){
System.out.println("est� en el primer cuadrante");
}else System.out.println("est� en el cuarto cuadrante");
}else
if(y>0){
System.out.println("est� en el segundo cuadrante");
}else System.out.println("est� en el tercer cuadrante");
}
}

Das könnte Ihnen auch gefallen