Package il.ac.idc.jdt

Class Triangle

    • Constructor Detail

      • Triangle

        public Triangle​(Point A,
                        Point B,
                        Point C)
        constructs a triangle form 3 point - store it in counterclockwised order.
      • Triangle

        public Triangle​(Point A,
                        Point B)
        creates a half plane using the segment (A,B).
        Parameters:
        A -
        B -
    • Method Detail

      • getBoundingBox

        public BoundingBox getBoundingBox()
        Returns:
        The bounding rectange between the minimum and maximum coordinates of the triangle
      • contains

        public boolean contains​(Point p)
        determinates if this triangle contains the point p.
        Parameters:
        p - the query point
        Returns:
        true iff p is not null and is inside this triangle (Note: on boundary is considered inside!!).
      • containsBoundaryIsOutside

        public boolean containsBoundaryIsOutside​(Point p)
        determinates if this triangle contains the point p.
        Parameters:
        p - the query point
        Returns:
        true iff p is not null and is inside this triangle (Note: on boundary is considered outside!!).
      • isCorner

        public boolean isCorner​(Point p)
        Checks if the given point is a corner of this triangle.
        Parameters:
        p - The given point.
        Returns:
        True iff the given point is a corner of this triangle. By Eyal Roth & Doron Ganel.
      • fallInsideCircumcircle

        public boolean fallInsideCircumcircle​(Point[] arrayPoints)
      • zValue

        public double zValue​(Point q)
        compute the Z value for the X,Y values of q.
        assume this triangle represent a plane --> q does NOT need to be contained in this triangle.
        Parameters:
        q - query point (its Z value is ignored).
        Returns:
        the Z value of this plane implies by this triangle 3 points.
      • getZ

        public double getZ​(double x,
                           double y)
        compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.
        Parameters:
        x - x-coordinate of the query point.
        y - y-coordinate of the query point.
        Returns:
        z (height) value approximation given by the triangle it falls in.
      • getZ

        public Point getZ​(Point q)
        compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.
        Parameters:
        q - query point (its Z value is ignored).
        Returns:
        q with updated Z value.
      • isMark

        public boolean isMark()
      • setMark

        public void setMark​(boolean mark)
      • getMc

        public int getMc()
        Modification counter for triangulation fast update
        Returns:
      • isHalfplane

        public boolean isHalfplane()
        returns true iff this triangle is actually a half plane.
      • setHalfplane

        public void setHalfplane​(boolean halfplane)
      • setMc

        public void setMc​(int mc)
      • getAbTriangle

        public Triangle getAbTriangle()
        returns the consecutive triangle which shares this triangle a,b edge.
      • setAbTriangle

        public void setAbTriangle​(Triangle abTriangle)
      • getBcTriangle

        public Triangle getBcTriangle()
        returns the consecutive triangle which shares this triangle b,c edge.
      • setBcTriangle

        public void setBcTriangle​(Triangle bcTriangle)
      • getCaTriangle

        public Triangle getCaTriangle()
        returns the consecutive triangle which shares this triangle c,a edge.
      • setCanext

        public void setCanext​(Triangle canext)
      • getA

        public Point getA()
        returns the first vertex of this triangle.
      • setA

        public void setA​(Point a)
      • getB

        public Point getB()
        returns the second vertex of this triangle.
      • setB

        public void setB​(Point b)
      • getC

        public Point getC()
        returns the 3th vertex of this triangle.
      • setC

        public void setC​(Point c)