JTS: 16 Orientation 方向

编程入门 行业动态 更新时间:2024-10-27 16:31:28

JTS: 16 Orientation <a href=https://www.elefans.com/category/jswz/34/1768686.html style=方向"/>

JTS: 16 Orientation 方向

这里写目录标题

      • 版本
      • 代码

版本

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));}

更多推荐

JTS: 16 Orientation 方向

本文发布于:2023-11-16 06:50:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1613841.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方向   JTS   Orientation

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!