已解决
JTS: 16 Orientation 方向
来自网友在路上 186886提问 提问时间:2023-11-07 06:29:19阅读次数: 86
最佳答案 问答题库868位专家为你答疑解惑
这里写目录标题
- 版本
- 代码
版本
org.locationtech.jts:jts-core:1.19.0
链接: github
代码
public static void main(String[] args) {OrientationUse orientationUse = new OrientationUse();orientationUse.test02();}public void test02() {A = new Coordinate(2, 1);B = new Coordinate(2, 2.5);C = new Coordinate(3, 4);int index = Orientation.index(A, B, C);LOGGER.info("index: {}", index);// 17:32:49.033 [main] INFO pers.stu.algorithm.AngleUse - index: -1}
public static void main(String[] args) {OrientationUse orientationUse = new OrientationUse();orientationUse.test00();}public void test00() {A = new Coordinate(2, 1);B = new Coordinate(2, 2.5);C = new Coordinate(2, 4);int index = Orientation.index(A, B, C);LOGGER.info("index: {}", index);// 17:25:11.618 [main] INFO pers.stu.algorithm.AngleUse - index: 0}
public static void main(String[] args) {OrientationUse orientationUse = new OrientationUse();orientationUse.test01();}public void test01() {A = new Coordinate(2, 1);B = new Coordinate(2, 2.5);C = new Coordinate(1, 4);int index = Orientation.index(A, B, C);LOGGER.info("index: {}", index);// 17:32:49.033 [main] INFO pers.stu.algorithm.AngleUse - index: 1}
public static void main(String[] args) {OrientationUse orientationUse = new OrientationUse();orientationUse.test04();}public void test04() {GeometryFactory geometryFactory = new GeometryFactory();Coordinate[] coordinates1 = new Coordinate[] {new Coordinate(1, 4), new Coordinate(1, 1.5), new Coordinate(4.5, 1.5), new Coordinate(4.5, 4),new Coordinate(1, 4)};// 是否是逆时针的环:trueCoordinate[] coordinates2 = new Coordinate[] {new Coordinate(1, 4), new Coordinate(4.5, 4), new Coordinate(4.5, 1.5), new Coordinate(1, 1.5),new Coordinate(1, 4)};// 是否是逆时针的环:falseLOGGER.info("是否是逆时针的环:{}", Orientation.isCCW(coordinates2));}
查看全文
99%的人还看了
猜你感兴趣
版权申明
本文"JTS: 16 Orientation 方向":http://eshow365.cn/6-34303-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!