object Triangle

Represents a planar triangle, and provides methods for calculating various properties of triangles.

Version

1.7

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Triangle
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def angleBisector(a: Coordinate, b: Coordinate, c: Coordinate): Coordinate

    Computes the point at which the bisector of the angle ABC cuts the segment AC.

    Computes the point at which the bisector of the angle ABC cuts the segment AC.

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the angle bisector cut point

  5. def area(a: Coordinate, b: Coordinate, c: Coordinate): Double

    Computes the 2D area of a triangle.

    Computes the 2D area of a triangle. The area value is always non-negative.

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the area of the triangle

    See also

    #signedArea(Coordinate, Coordinate, Coordinate)

  6. def area3D(a: Coordinate, b: Coordinate, c: Coordinate): Double

    Computes the 3D area of a triangle.

    Computes the 3D area of a triangle. The value computed is always non-negative.

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the 3D area of the triangle

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def centroid(a: Coordinate, b: Coordinate, c: Coordinate): Coordinate

    Computes the centroid (centre of mass) of a triangle.

    Computes the centroid (centre of mass) of a triangle. This is also the point at which the triangle's three medians intersect (a triangle median is the segment from a vertex of the triangle to the midpoint of the opposite side). The centroid divides each median in a ratio of 2:1.

    The centroid always lies within the triangle.

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the centroid of the triangle

  9. def circumcentre(a: Coordinate, b: Coordinate, c: Coordinate): Coordinate

    Computes the circumcentre of a triangle.

    Computes the circumcentre of a triangle. The circumcentre is the centre of the circumcircle, the smallest circle which encloses the triangle. It is also the common intersection point of the perpendicular bisectors of the sides of the triangle, and is the only point which has equal distance to all three vertices of the triangle.

    The circumcentre does not necessarily lie within the triangle. For example, the circumcentre of an obtuse isosceles triangle lies outside the triangle.

    This method uses an algorithm due to J.R.Shewchuk which uses normalization to the origin to improve the accuracy of computation. (See Lecture Notes on Geometric Robustness, Jonathan Richard Shewchuk, 1999).

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the circumcentre of the triangle

  10. def circumcentreDD(a: Coordinate, b: Coordinate, c: Coordinate): Coordinate

    Computes the circumcentre of a triangle.

    Computes the circumcentre of a triangle. The circumcentre is the centre of the circumcircle, the smallest circle which encloses the triangle. It is also the common intersection point of the perpendicular bisectors of the sides of the triangle, and is the only point which has equal distance to all three vertices of the triangle.

    The circumcentre does not necessarily lie within the triangle. For example, the circumcentre of an obtuse isosceles triangle lies outside the triangle.

    This method uses {link DD} extended-precision arithmetic to provide more accurate results than {link #circumcentre(Coordinate, Coordinate, Coordinate)}

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the circumcentre of the triangle

  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def inCentre(a: Coordinate, b: Coordinate, c: Coordinate): Coordinate

    Computes the incentre of a triangle.

    Computes the incentre of a triangle. The inCentre of a triangle is the point which is equidistant from the sides of the triangle. It is also the point at which the bisectors of the triangle's angles meet. It is the centre of the triangle's incircle, which is the unique circle that is tangent to each of the triangle's three sides.

    The incentre always lies within the triangle.

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the point which is the incentre of the triangle

  18. def interpolateZ(p: Coordinate, v0: Coordinate, v1: Coordinate, v2: Coordinate): Double

    Computes the Z-value (elevation) of an XY point on a three-dimensional plane defined by a triangle whose vertices have Z-values.

    Computes the Z-value (elevation) of an XY point on a three-dimensional plane defined by a triangle whose vertices have Z-values. The defining triangle must not be degenerate (in other words, the triangle must enclose a non-zero area), and must not be parallel to the Z-axis.

    This method can be used to interpolate the Z-value of a point inside a triangle (for example, of a TIN facet with elevations on the vertices).

    p

    the point to compute the Z-value of

    v0

    a vertex of a triangle, with a Z ordinate

    v1

    a vertex of a triangle, with a Z ordinate

    v2

    a vertex of a triangle, with a Z ordinate return the computed Z-value (elevation) of the point

  19. def isAcute(a: Coordinate, b: Coordinate, c: Coordinate): Boolean

    Tests whether a triangle is acute.

    Tests whether a triangle is acute. A triangle is acute iff all interior angles are acute. This is a strict test - right triangles will return false A triangle which is not acute is either right or obtuse.

    Note: this implementation is not robust for angles very close to 90 degrees.

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return true if the triangle is acute

  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def longestSideLength(a: Coordinate, b: Coordinate, c: Coordinate): Double

    Computes the length of the longest side of a triangle

    Computes the length of the longest side of a triangle

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the length of the longest side of the triangle

  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def perpendicularBisector(a: Coordinate, b: Coordinate): HCoordinate

    Computes the line which is the perpendicular bisector of the line segment a-b.

    Computes the line which is the perpendicular bisector of the line segment a-b.

    a

    a point

    b

    another point return the perpendicular bisector, as an HCoordinate

  26. def signedArea(a: Coordinate, b: Coordinate, c: Coordinate): Double

    Computes the signed 2D area of a triangle.

    Computes the signed 2D area of a triangle. The area value is positive if the triangle is oriented CW, and negative if it is oriented CCW.

    The signed area value can be used to determine point orientation, but the implementation in this method is susceptible to round-off errors. Use {link Orientation#index(Coordinate, Coordinate, Coordinate)} for robust orientation calculation.

    a

    a vertex of the triangle

    b

    a vertex of the triangle

    c

    a vertex of the triangle return the signed 2D area of the triangle

    See also

    Orientation#index(Coordinate, Coordinate, Coordinate)

  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped