Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int oblicz() throws Exception { //obsługa wyjątków
- double a, b;
- int c = 0;
- try {
- a = ((Double.parseDouble(y3.getText()) - Double.parseDouble(y1.getText()))*((Double.parseDouble(x2.getText()) - Double.parseDouble(x1.getText()))));
- b = ((Double.parseDouble(y2.getText()) - Double.parseDouble(y1.getText()))*((Double.parseDouble(x3.getText()) - Double.parseDouble(x1.getText()))));
- if (a == b) { //jeśli warunek spełniony, to leżą na jednej prostej
- c = 1;
- } else //jeśli nie jest spełniony
- {
- c = 0;
- }
- return c;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement