Notice
Recent Posts
Recent Comments
Link
250x250
목록거리 (1)
develope_kkyu
[JAVA] 두 점 사이의 거리 구하기
MyPoint.java public class MyPoint { public int x; public int y; MyPoint(int x, int y){ this.x = x; this.y = y; } public double getDistance(int i, int j) { double dis; dis = Math.sqrt((this.x-i)*(this.x-i) + (this.y-j)*(this.y-j)); return dis; } } MyPointExam.java public class MyPointExam { public static void main(String[] args) { //System.out.println(Math.sqrt(4));// 2.0*2.0 == 4 //System.out.pr..
JAVA/Java SE
2022. 12. 21. 16:27