# Vector4Vector4 Struct

## Definition

Represents a 4D vector using four single-precision floating-point numbers.

``````[System.Serializable]
public struct Vector4 : IEquatable<OpenTK.Vector4>``````
``type Vector4 = struct``
Inheritance
Vector4Vector4
Attributes
Implements

## Remarks

The Vector4 structure is suitable for interoperation with unmanaged code requiring four consecutive floats.

## Constructors

 Vector4(Vector2) Vector4(Vector2) Constructs a new Vector4 from the given Vector2. Vector4(Vector3) Vector4(Vector3) Constructs a new Vector4 from the given Vector3. Vector4(Vector4) Vector4(Vector4) Constructs a new Vector4 from the given Vector4. Vector4(Single) Vector4(Single) Vector4(Vector3, Single) Vector4(Vector3, Single) Vector4(Single, Single, Single, Single) Vector4(Single, Single, Single, Single) Constructs a new Vector4.

## Fields

 One One Defines an instance with all components set to 1. SizeInBytes SizeInBytes Defines the size of the Vector4 struct in bytes. UnitW UnitW Defines a unit-length Vector4 that points towards the W-axis. UnitX UnitX Defines a unit-length Vector4 that points towards the X-axis. UnitY UnitY Defines a unit-length Vector4 that points towards the Y-axis. UnitZ UnitZ Defines a unit-length Vector4 that points towards the Z-axis. W W The Z component of the Vector4. X X The X component of the Vector4. Y Y The Y component of the Vector4. Z Z The Z component of the Vector4. Zero Zero Defines a zero-length Vector4.

## Properties

 Length Length Gets the length (magnitude) of the vector. LengthFast LengthFast Gets an approximation of the vector length (magnitude). LengthSquared LengthSquared Gets the square of the vector length (magnitude). Xy Xy Gets or sets an OpenTK.Vector2 with the X and Y components of this instance. Xyz Xyz Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.