com.supermap.data

类 Segment3D



  • public class Segment3D
    extends Object
    三维线段类。

    用于表示精度为 double 的三维线段结构。

    当使用默认构造函数创建一个 Vector3D 对象时,其 起始坐标为(0,0,0),终点坐标为(1,0,0)

    该类除提供设置获取起始终止点及获取长度及方向的方法。

    • 构造器详细资料

      • Segment3D

        public Segment3D()
        构造默认三维线段。
      • Segment3D

        public Segment3D(Point3D startPoint,
                         Point3D endPoint)
        根据给定起点终点构造三维线段。
        参数:
        startPoint - 起点,可以是Point3D,也可以是Vector3D。
        endPoint - 终点,可以是Point3D,也可以是Vector3D。
      • Segment3D

        public Segment3D(Point2D startPoint,
                         Point2D endPoint)
        根据给定二维起点终点构造三维线段(Z均为零)。
        参数:
        startPoint - 起点。
        endPoint - 终点。
      • Segment3D

        public Segment3D(Segment3D other)
        根据给定三维线段构造新三维线段(Z均为零)。
        参数:
        other - 三维线段。
    • 方法详细资料

      • getLength

        public double getLength()
        返回当前三维线段的长度。
        返回:
        长度。
      • getStartPoint

        public Vector3D getStartPoint()
        返回当前三维线段的起点。
        返回:
        长度。
      • setStartPoint

        public void setStartPoint(Vector3D startPoint)
        设置当前三维线段的起点。
        参数:
        startPoint - 起点
      • getEndPoint

        public Vector3D getEndPoint()
        设置当前三维线段的终点。
        返回:
        终点
      • setEndPoint

        public void setEndPoint(Vector3D endPoint)
        设置当前三维线段的终点。
        参数:
        endPoint - 终点
      • getDirection

        public Vector3D getDirection()
        设置当前三维线段的方向(单位向量)。
        返回:
        方向
      • isDegenerated

        public boolean isDegenerated()
        当前向量是否退化
        返回:
        是否退化

Copyright © 2021–2024 SuperMap. All rights reserved.