record TPoint2f

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TPoint2f = record

Description

2D floating-point vector.

Overview

Fields

X: VectorFloat;
Y: VectorFloat;

Methods

function Angle: VectorFloat; inline;
function Cross(const Point: TPoint2f): VectorFloat; inline;
function Distance(const Point: TPoint2f): VectorFloat; inline;
function Dot(const Point: TPoint2f): VectorFloat; inline;
function Empty: Boolean; inline;
function InsideTriangle(const Vertex1, Vertex2, Vertex3: TPoint2f): Boolean;
function Length: VectorFloat; inline;
function Lerp(const Point: TPoint2f; const Theta: VectorFloat): TPoint2f;
function Normalize: TPoint2f;
function Swap: TPoint2f; inline;
function ToInt: TPoint2i;

Description

Fields

X: VectorFloat;

The coordinate in 2D space.

Y: VectorFloat;

The coordinate in 2D space.

Methods

function Angle: VectorFloat; inline;

Returns an angle (in radians) at which current is pointing at.

function Cross(const Point: TPoint2f): VectorFloat; inline;

Calculates a cross product between current and the specified 2D vectors, or analog of thereof.

function Distance(const Point: TPoint2f): VectorFloat; inline;

Calculates distance between current and given points.

function Dot(const Point: TPoint2f): VectorFloat; inline;

Calculates a dot product between current and the specified 2D vectors. The dot product is an indirect measure of the angle between two vectors.

function Empty: Boolean; inline;

Tests whether both X and Y are nearly zero.

function InsideTriangle(const Vertex1, Vertex2, Vertex3: TPoint2f): Boolean;

Tests whether current point is inside the triangle specified by given three vertices.

function Length: VectorFloat; inline;

Returns the length of current 2D vector.

function Lerp(const Point: TPoint2f; const Theta: VectorFloat): TPoint2f;

Interpolates between current and destination 2D vectors.

Parameters
Point
The destination vector to be used in the interpolation
Theta
The mixture of the two vectors with the a range of [0..1].
function Normalize: TPoint2f;

Normalizes current vector to unity length. If the vector is of zero length, it will remain unchanged.

function Swap: TPoint2f; inline;

Returns vector with X and Y swapped.

function ToInt: TPoint2i;

Converts TPoint2f to TPoint2i by using floating-point rounding.


Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.