Namespace: Rx.Net – Class: Vector4D – Assembly: Rx.Net

Vector4D Struct

C#
struct Vector4D

A structure encapsulating four double precision floating point values.

Constructors

Vector4D(value)

Constructs a vector whose elements are all the single specified value.

Vector4D(x, y, z, w)

Constructs a vector with the given individual elements.

Vector4D(value, z, w)

Constructs a Vector4D from the given Vector2D and a Z and W component.

Vector4D(value, w)

Constructs a Vector4D from the given Vector3D and a W component.

Vector4D(xColor)

Constructs a Vector4D from the given color. The values are stored normalized.

Vector4D(eKnownColor)

Constructs a Vector4D from the given known color. The values are stored normalized.

Properties

XY

Returns a new 2D vector containing X and Y of this vector.

YX

Returns a new 2D vector containing Y and X of this vector.

XYZ

Returns a new 3D vector containing X, Y and Z of this vector.

R

Accesses the X component of this vector.

G

Accesses the Y component of this vector.

B

Accesses the Z component of this vector.

A

Accesses the W component of this vector.

RGB

Returns a new 3D vector containing R, G and B of this vector.

Static Properties

Zero

Returns the vector (0,0,0,0).

One

Returns the vector (1,1,1,1).

UnitX

Returns the vector (1,0,0,0).

UnitY

Returns the vector (0,1,0,0).

UnitZ

Returns the vector (0,0,1,0).

UnitW

Returns the vector (0,0,0,1).

Transparent

Transparent color.

AliceBlue
AntiqueWhite
Aqua
Aquamarine
Azure
Beige
Bisque
Black
BlanchedAlmond
Blue
BlueViolet
Brown
BurlyWood
CadetBlue
Chartreuse
Chocolate
Coral
CornflowerBlue
Cornsilk
Crimson
Cyan
DarkBlue
DarkCyan
DarkGoldenrod
DarkGray
DarkGreen
DarkKhaki
DarkMagenta
DarkOliveGreen
DarkOrange
DarkOrchid
DarkRed
DarkSalmon
DarkSeaGreen
DarkSlateBlue
DarkSlateGray
DarkTurquoise
DarkViolet
DeepPink
DeepSkyBlue
DimGray
DodgerBlue
Firebrick
FloralWhite
ForestGreen
Fuchsia
Gainsboro
GhostWhite
Gold
Goldenrod
Gray
Green
GreenYellow
Honeydew
HotPink
IndianRed
Indigo
Ivory
Khaki
Lavender
LavenderBlush
LawnGreen
LemonChiffon
LightBlue
LightCoral
LightCyan
LightGoldenrodYellow
LightGreen
LightGray
LightPink
LightSalmon
LightSeaGreen
LightSkyBlue
LightSlateGray
LightSteelBlue
LightYellow
Lime
LimeGreen
Linen
Magenta
Maroon
MediumAquamarine
MediumBlue
MediumOrchid
MediumPurple
MediumSeaGreen
MediumSlateBlue
MediumSpringGreen
MediumTurquoise
MediumVioletRed
MidnightBlue
MintCream
MistyRose
Moccasin
NavajoWhite
Navy
OldLace
Olive
OliveDrab
Orange
OrangeRed
Orchid
PaleGoldenrod
PaleGreen
PaleTurquoise
PaleVioletRed
PapayaWhip
PeachPuff
Peru
Pink
Plum
PowderBlue
Purple
Red
RosyBrown
RoyalBlue
SaddleBrown
Salmon
SandyBrown
SeaGreen
SeaShell
Sienna
Silver
SkyBlue
SlateBlue
SlateGray
Snow
SpringGreen
SteelBlue
Tan
Teal
Thistle
Tomato
Turquoise
Violet
Wheat
White
WhiteSmoke
Yellow
YellowGreen
RaytrixBlue
RaytrixLightBlue

Methods

Equals(other)

Returns a boolean indicating whether the given Vector4D is equal to this Vector4D instance.

GetHashCode()

Returns the hash code for this instance.

Equals(obj)

Returns a boolean indicating whether the given Object is equal to this Vector4D instance.

ToString()

Returns a String representing this Vector4D instance.

ToString(format)

Returns a String representing this Vector4D instance, using the specified format to format individual elements.

ToString(format, formatProvider)

Returns a String representing this Vector4D instance, using the specified format to format individual elements and the given IFormatProvider.

Length()

Returns the length of the vector. This operation is cheaper than Length().

LengthSquared()

Returns the length of the vector squared.

ToARGB()

Converts this object to an ARGB value.

Static Methods

Dot(vector1, vector2)

Returns the dot product of two vectors.

Min(value1, value2)

Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors.

Max(value1, value2)

Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors.

Abs(value)

Returns a vector whose elements are the absolute values of each of the source vector's elements.

SquareRoot(value)

Returns a vector whose elements are the square root of each of the source vector's elements.

Length(value)

Returns the length of the vector.

Distance(value1, value2)

Returns the Euclidean distance between the two given points.

DistanceSquared(value1, value2)

Returns the Euclidean distance squared between the two given points.

Normalize(vector)

Returns a vector with the same direction as the given vector, but with a length of 1.

Clamp(value1, min, max)

Restricts a vector between a min and max value.

FromARGB(argbColor)

Creates a color from the given ARGB value.

FromRGBA(iRed, iGreen, iBlue, iAlpha)

Creates a color from the given RGBA values. The possible value range is 0 - 255.

FromRGB(iRed, iGreen, iBlue)

Creates a color from the given RGB values. The possible value range is 0 - 255. The alpha value is 255.

FromHex(iColor)

Creates a color from the given hex value (e.g. 0xFF0000 for red). The alpha value is 255.

FromHex(iColor, iAlpha)

Creates a color from the given hex value (e.g. 0xFF0000 for red) and the given alpha value.

Operators

operator Vector4D(xColor)

Implicit Vector4D casting operator. Constructs a Vector4D from the given color. The values are stored normalized.

operator Vector4D(eKnownColor)

Implicit vector4D casting operator. Constructs a Vector4D from the given known color. The values are stored normalized.

operator+(left, right)

Adds two vectors together.

operator-(left, right)

Subtracts the second vector from the first.

operator*(left, right)

Multiplies two vectors together.

operator*(left, right)

Multiplies a vector by the given scalar.

operator*(left, right)

Multiplies a vector by the given scalar.

operator/(left, right)

Divides the first vector by the second.

operator/(value1, value2)

Divides the vector by the given scalar.

operator-(value)

Negates a given vector.

operator==(left, right)

Returns a boolean indicating whether the two given vectors are equal.

operator!=(left, right)

Returns a boolean indicating whether the two given vectors are not equal.

Variables

X

The X component of the vector.

Y

The Y component of the vector.

Z

The Z component of the vector.

W

The W component of the vector.