# System.Math.Vectors.TVector

Object Pascal

```  TVector = record
class function Create(const AX, AY: Single; const AW: Single = 1.0): TVector; overload; static; inline;
class function Create(const APoint: TPointF): TVector; overload; static; inline;
class operator Add(const AVector1, AVector2: TVector): TVector;
class operator Subtract(const AVector1, AVector2: TVector): TVector;
class operator Equal(const AVector1, AVector2: TVector): Boolean; inline;
class operator NotEqual(const AVector1, AVector2: TVector): Boolean; inline;
class operator Implicit(const APoint: TPointF): TVector; inline;
class operator Explicit(const APoint: TVector): TPointF;
class operator Implicit(const APoint: TVector): TPointF; inline; deprecated 'Implicit conversion from TVector to TPointF requires homogenization';
class operator Implicit(const ASize: TSizeF): TVector; inline;
class operator Multiply(const AVector: TVector; const AFactor: Single): TVector;
class operator Multiply(const AFactor: Single; const AVector: TVector): TVector; inline;
class operator Divide(const AVector: TVector; const AFactor: Single): TVector;
function Length: Single;
function Normalize: TVector;
function CrossProduct(const AVector: TVector): TVector;
function DotProduct(const AVector: TVector): Single;
function MidVector(const AVector: TVector): TVector;
function ToPointF: TPointF; inline; deprecated 'Use explicit typecast instead.';
case Integer of
0: (V: TVectorArray;);
1: (X: Single;
Y: Single;
W: Single;);
end;
```

C++

```struct DECLSPEC_DRECORD TVector
{
public:
static TVector __fastcall Create(const float AX, const float AY, const float AW = 1.000000E+00f)/* overload */;
#ifndef _WIN64
static TVector __fastcall Create(const System::Types::TPointF &APoint)/* overload */;
#else /* _WIN64 */
static TVector __fastcall Create(const System::Types::TPointF APoint)/* overload */;
#endif /* _WIN64 */
static TVector __fastcall _op_Addition(const TVector &AVector1, const TVector &AVector2);
static TVector __fastcall _op_Subtraction(const TVector &AVector1, const TVector &AVector2);
static bool __fastcall _op_Equality(const TVector &AVector1, const TVector &AVector2);
static bool __fastcall _op_Inequality(const TVector &AVector1, const TVector &AVector2);
#ifndef _WIN64
static TVector __fastcall _op_Implicit(const System::Types::TPointF &APoint);
#else /* _WIN64 */
static TVector __fastcall _op_Implicit(const System::Types::TPointF APoint);
#endif /* _WIN64 */
__fastcall operator System::Types::TPointF() _DEPRECATED_ATTRIBUTE1("Implicit conversion from TVector to TPointF requires homogenization") ;
#ifndef _WIN64
static TVector __fastcall _op_Implicit(const System::Types::TSizeF &ASize);
#else /* _WIN64 */
static TVector __fastcall _op_Implicit(const System::Types::TSizeF ASize);
#endif /* _WIN64 */
static TVector __fastcall _op_Multiply(const TVector &AVector, const float AFactor);
static TVector __fastcall _op_Multiply(const float AFactor, const TVector &AVector);
static TVector __fastcall _op_Division(const TVector &AVector, const float AFactor);
float __fastcall Length(void);
TVector __fastcall Normalize(void);
TVector __fastcall CrossProduct(const TVector &AVector);
float __fastcall DotProduct(const TVector &AVector);
TVector __fastcall MidVector(const TVector &AVector);
System::Types::TPointF __fastcall ToPointF _DEPRECATED_ATTRIBUTE1("Use explicit typecast instead.") (void);
union
{
struct
{
float X;
float Y;
float W;
};
struct
{
TVectorArray V;
};
};
};
```

## Contents

#### Properties

Type Visibility Source Unit Parent
record
struct
public
System.Math.Vectors.pas
System.Math.Vectors.hpp
System.Math.Vectors System.Math.Vectors

## Description

TVector is a vector in a two-dimensional space.

TVector is a record that represents a vector in a two-dimensional space. The vector has its initial point in (0, 0). `X` and `Y` are the coordinates of the terminal point of the vector. To be able to realize a vector transformation, using a transformation matrix, the coordinates number is extended to three. So, `W` represents a coordinate that will help in vector transformation.