package ru.study.sandbox;

import static java.lang.Math.pow;
import static java.lang.Math.sqrt;

public class MyFirstProgram {
	public static void main (String[] args)	{
		Point p1 = new Point(-1,100);
		Point p2 = new Point(2, -1);

		System.out.println("Расстояние между двумя точками, вычисленное при помощи функции distance: " + distance(p1, p2));
		System.out.println("Расстояние между двумя точками, вычисленное при помощи метода класса Point: " + p1.distance(p1, p2));
	}

	public static double distance(Point p1, Point p2){
		return sqrt(pow(p1.getX()-p2.getX(),2)+pow(p1.getY()-p2.getY(),2));
	}
}

@@ -225,16 +225,48 @@
 (2, -1);
+%0A%09%09Point p3 = new Point(5, -10);
 %0A%0A%09%09Syst
@@ -377,16 +377,17 @@
 , p2));%0A
+%0A
 %09%09System
@@ -477,17 +477,21 @@
 Point: %22
- 
+%0A%09%09%09%09
 + p1.dis
@@ -506,16 +506,297 @@
 , p2));%0A
+%09%09System.out.println(%22%D0%A0%D0%B0%D1%81%D1%81%D1%82%D0%BE%D1%8F%D0%BD%D0%B8%D0%B5 %D0%BC%D0%B5%D0%B6%D0%B4%D1%83 %D0%B4%D0%B2%D1%83%D0%BC%D1%8F %D1%82%D0%BE%D1%87%D0%BA%D0%B0%D0%BC%D0%B8, %D0%B2%D1%8B%D1%87%D0%B8%D1%81%D0%BB%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5 %D0%BF%D1%80%D0%B8 %D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D0%B8 %D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D0%B0 %D0%BA%D0%BB%D0%B0%D1%81%D1%81%D0%B0 Point: %22%0A%09%09%09%09+ p1.distance(p2, p3));%0A%09%09System.out.println(%22%D0%A0%D0%B0%D1%81%D1%81%D1%82%D0%BE%D1%8F%D0%BD%D0%B8%D0%B5 %D0%BC%D0%B5%D0%B6%D0%B4%D1%83 %D0%B4%D0%B2%D1%83%D0%BC%D1%8F %D1%82%D0%BE%D1%87%D0%BA%D0%B0%D0%BC%D0%B8, %D0%B2%D1%8B%D1%87%D0%B8%D1%81%D0%BB%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5 %D0%BF%D1%80%D0%B8 %D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D0%B8 %D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D0%B0 %D0%BA%D0%BB%D0%B0%D1%81%D1%81%D0%B0 Point: %22%0A%09%09%09%09+ p3.distance(new Point(0,0), new Point(0, 5)));%0A
 %09%7D%0A%0A%09pub

add examples