public Punto corteEntreRestricciones(Restriccion r1, Restriccion r2) { if (r1.cY == 0 && r2.cY == 0 || (r1.cX == 0 && r2.cX == 0)) { return(null); } else if (r1.cX == 0 && r2.cY == 0) { return(new Punto(r2.cX, r1.cY)); } else if (r1.cY == 0 && r2.cX == 0) { return(new Punto(r1.cX, r2.cY)); } else { double y = ((r1.cDerecha * r2.cX) - (r1.cX * r2.cDerecha)) / ((r2.cX * r1.cY) - (r1.cX * r2.cY)); double x = (r1.cDerecha - (r1.cY * y)) / r1.cX; return(new Punto(x, y)); } }
public Boolean Equals(Restriccion r) { return r.cX == cX && r.cY == cY && r.cDerecha == cDerecha; }
public bool restriccionesIguales(Restriccion r1, Restriccion r2) { return(r1.Equals(r2)); }