TQuad

The TQuad type is a record which stores four TPoints (Top, Right, Bottom, Left) See: https://en.wikipedia.org/wiki/Quadrilateral

  • Top is the “most” top point (lowest Y)

  • Right is the “most” right point (highest X)

  • Bottom is the “most” bottom point (highest Y)

  • Left is the “most” left point (lowest X)


TQuad.Create

function TQuad.Create(ATop, ARight, ABottom, ALeft: TPoint): TQuad; static;

TQuad.Create

function TQuad.Create(Box: TBox): TQuad; static;

TQuad.Create

function TQuad.Create(Points: TPointArray): TQuad; static;

TQuad.ToTPA

function TQuad.ToTPA: TPointArray;

TQuad.Bounds

function TQuad.Bounds: TBox;

TQuad.ShortSideLen

function TQuad.ShortSideLen: Integer;

TQuad.LongSideLen

function TQuad.LongSideLen: Integer;

TQuad.Mean

function TQuad.Mean: TPoint;

TQuad.Rotate

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

TQuad.Contains

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

TQuad.Contains

function TQuad.Contains(X, Y: Integer): Boolean;

TQuad.Offset

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

TQuad.Offset

function TQuad.Offset(X, Y: Integer): TQuad;

TQuad.Extract

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

Returns all points that are in the quad.

TQuad.Exclude

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

Returns all points that are not inside the quad.

TQuad.Expand

function TQuad.Expand(Amount: Double): TQuad;

TQuad.NearestEdge

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

TQuad.Area

function TQuad.Area: Integer;

TQuad.Normalize

function TQuad.Normalize: TQuad;

TQuad.RandomPoint

function TQuad.RandomPoint: TPoint;

Returns a completely random point in the quad.

TQuad.RandomPointCenter

function TQuad.RandomPointCenter: TPoint;

Returns a random point in the quad which is weighted torwards the quad’s center.

in

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