object Triangle
Represents a planar triangle, and provides methods for calculating various properties of triangles.
- Version
1.7
- Alphabetic
- By Inheritance
- Triangle
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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
- 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)
- 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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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
- 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
- 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
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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
- 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
- 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
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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
- 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)
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()