Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Glavni{
- public static void main(String args[]){
- Tocka t1,t2;
- t1 = new Tocka(Double.parseDouble(args[0]),Double.parseDouble(args[1]));
- t2 = new Tocka(Double.parseDouble(args[2]),Double.parseDouble(args[3]));
- System.out.println(t1.greaterDistance(t2));
- }
- }
- public class Tocka{
- private double xkord, ykord;
- public Tocka(double xkord, double ykord){
- this.xkord = xkord;
- this.ykord = ykord;
- }
- public boolean greaterDistance(Tocka x) {
- return Math.sqrt((this.xkord * this.xkord) + (this.ykord * this.ykord)) > Math.sqrt((x.xkord * x.xkord ) + (x.ykord * x.ykord) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement