Skip to content

Commit 68c3b42

Browse files
committed
GIS基本算法--03计算点到直线段的最短距离测试类
1 parent 88f3e3f commit 68c3b42

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/test/Test03.java

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package test;
2+
3+
import algo.MinPointToPolyline;
4+
import entity.Point;
5+
6+
/**
7+
* @ClassName Test03
8+
* @Description 测试点到线段的最短距离
9+
* @Author luokai
10+
* @CreateDate 2020/8/16 22:35
11+
* @UPpdateUser luokai
12+
* @UpdateDate 2020/8/16 22:35
13+
* @UpdateRemark
14+
* @Version 1.0
15+
* Copyright (c) 2019,武汉中地云申科技有限公司
16+
* All rights reserved.
17+
**/
18+
public class Test03 {
19+
20+
public static void main(String args[]){
21+
Point p1 = new Point(10,5);
22+
Point p2 = new Point(20,10);
23+
Point q = new Point(15,8);
24+
MinPointToPolyline minPointToPolyline = new MinPointToPolyline();
25+
double distance = minPointToPolyline.MinPointToPolyline(p1, p2, q);
26+
System.out.println(distance);
27+
}
28+
29+
}

0 commit comments

Comments
 (0)