Class JavaTriangle2D

    • Method Detail

      • contains

        public boolean contains​(JavaPoint2D point)
        Tests if a 2D point lies inside this 2D triangle. See Real-Time Collision Detection, chap. 5, p. 206.
        Parameters:
        point - The point to be tested
        Returns:
        Returns true iff the point lies inside this 2D triangle
      • isPointInCircumcircle

        public boolean isPointInCircumcircle​(JavaPoint2D point)
        Tests if a given point lies in the circumcircle of this triangle. Let the triangle ABC appear in counterclockwise (CCW) order. Then when det > 0, the point lies inside the circumcircle through the three points a, b and c. If instead det < 0, the point lies outside the circumcircle. When det = 0, the four points are cocircular. If the triangle is oriented clockwise (CW) the result is reversed. See Real-Time Collision Detection, chap. 3, p. 34.
        Parameters:
        point - The point to be tested
        Returns:
        Returns true iff the point lies inside the circumcircle through the three points a, b, and c of the triangle
      • isOrientedCCW

        public boolean isOrientedCCW()
        Test if this triangle is oriented counterclockwise (CCW). Let A, B and C be three 2D points. If det > 0, C lies to the left of the directed line AB. Equivalently the triangle ABC is oriented counterclockwise. When det < 0, C lies to the right of the directed line AB, and the triangle ABC is oriented clockwise. When det = 0, the three points are colinear. See Real-Time Collision Detection, chap. 3, p. 32
        Returns:
        Returns true iff the triangle ABC is oriented counterclockwise (CCW)
      • isNeighbour

        public boolean isNeighbour​(JavaLine2D edge)
        Returns true if this triangle contains the given edge.
        Parameters:
        edge - The edge to be tested
        Returns:
        Returns true if this triangle contains the edge
      • getNoneEdgeVertex

        public JavaPoint2D getNoneEdgeVertex​(JavaLine2D edge)
        Returns the vertex of this triangle that is not part of the given edge.
        Parameters:
        edge - The edge
        Returns:
        The vertex of this triangle that is not part of the edge
      • hasVertex

        public boolean hasVertex​(JavaPoint2D vertex)
        Returns true if the given vertex is one of the vertices describing this triangle.
        Parameters:
        vertex - The vertex to be tested
        Returns:
        Returns true if the Vertex is one of the vertices describing this triangle