TTriangle

The TTriangle type is a record which stores three TPoints (A, B, C)

See: https://en.wikipedia.org/wiki/Triangle

The order of A,B,C should not matter in any functions for it.


TTriangle.Create

function TTriangle.Create(A, B, C: TPoint): TTriangle; static;

TTriangle.Centroid

function TTriangle.Centroid(): TPoint;

Same as Mean, as mean of a triangle is also the Centroid.


TTriangle.SymmedianPoint

function TTriangle.SymmedianPoint(): TPoint;

The symmedian point is the intersection of the symmedians (reflections of the medians across the angle bisectors).


TTriangle.Incenter

function TTriangle.Incenter(): TPoint;

The incenter is the center of the incircle, which is the largest circle that can fit entirely inside the triangle, tangent to all three sides.


TTriangle.Rotate

function TTriangle.Rotate(Angle: Double): TTriangle;

TTriangle.Contains

function TTriangle.Contains(P: TPoint): Boolean;

TTriangle.Offset

function TTriangle.Offset(P: TPoint): TTriangle;

TTriangle.Extract

function TTriangle.Extract(Points: TPointArray): TPointArray;

Returns all points that are in the triangle.


TTriangle.Exclude

function TTriangle.Exclude(Points: TPointArray): TPointArray;

Returns all points that are not inside the triangle.


TTriangle.Expand

function TTriangle.Expand(Amount: Integer): TTriangle;

TTriangle.NearestEdge

function TTriangle.NearestEdge(P: TPoint): TPoint;

Returns the point on the outline of the triangle which is nearest to P


TTriangle.IsObtuse

function TTriangle.IsObtuse(): Boolean; overload;
function TTriangle.IsObtuse(out Obstuse: TPoint): Boolean; overload;

Returns True if the triangle is obtuse, can also return the point

Obtuse triangle is a triangle in which one of it angles is greater than 90 degrees.


TTriangle.Circumcircle

function TTriangle.Circumcircle(): TCircle; 

Returns the circumcircle (the circle passing through points A, B, and C) of the triangle.


TTriangle.Incircle

function TTriangle.Incircle(): TCircle;

Returns the incircle (the largest circle inscribed within the triangle A, B, and C).


TTriangle.RandomPoint

function TTriangle.RandomPoint(): TPoint;

TTriangle.RandomPointCenter

function TTriangle.RandomPointCenter(): TPoint;

TTriangle.Area

property TTriangle.Area: Integer;

TTriangle.Corners

property TTriangle.Corners: TPointArray;

TTriangle.Bounds

property TTriangle.Bounds: TBox;

TTriangle.Mean

property TTriangle.Mean: TPoint;

in

operator in(Left: TPoint; Right: TTriangle): Boolean;