Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. int oblicz() throws Exception { //obsługa wyjątków
  2. double a, b;
  3. int c = 0;
  4. try {
  5. a = ((Double.parseDouble(y3.getText()) - Double.parseDouble(y1.getText()))*((Double.parseDouble(x2.getText()) - Double.parseDouble(x1.getText()))));
  6. b = ((Double.parseDouble(y2.getText()) - Double.parseDouble(y1.getText()))*((Double.parseDouble(x3.getText()) - Double.parseDouble(x1.getText()))));
  7.  
  8. if (a == b) { //jeśli warunek spełniony, to leżą na jednej prostej
  9. c = 1;
  10. } else //jeśli nie jest spełniony
  11. {
  12. c = 0;
  13. }
  14. return c;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement