Struct float2
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Syntax
[Serializable]
public struct float2 : IEquatable<float2>, IFormattable
Constructors
float2(Boolean)
Constructs a float2 vector from a single bool value by converting it to float and assigning it to every component.
Declaration
Parameters
Type |
Name |
Description |
System.Boolean |
v |
|
float2(Double)
Constructs a float2 vector from a single double value by converting it to float and assigning it to every component.
Declaration
Parameters
Type |
Name |
Description |
System.Double |
v |
|
float2(Int32)
Constructs a float2 vector from a single int value by converting it to float and assigning it to every component.
Declaration
Parameters
Type |
Name |
Description |
System.Int32 |
v |
|
float2(Single)
Constructs a float2 vector from a single float value by assigning it to every component.
Declaration
Parameters
Type |
Name |
Description |
System.Single |
v |
|
float2(Single, Single)
Constructs a float2 vector from two float values.
Declaration
public float2(float x, float y)
Parameters
Type |
Name |
Description |
System.Single |
x |
|
System.Single |
y |
|
float2(UInt32)
Constructs a float2 vector from a single uint value by converting it to float and assigning it to every component.
Declaration
Parameters
Type |
Name |
Description |
System.UInt32 |
v |
|
float2(bool2)
Constructs a float2 vector from a bool2 vector by componentwise conversion.
Declaration
Parameters
Type |
Name |
Description |
bool2 |
v |
|
float2(double2)
Constructs a float2 vector from a double2 vector by componentwise conversion.
Declaration
Parameters
float2(float2)
Constructs a float2 vector from a float2 vector.
Declaration
Parameters
Type |
Name |
Description |
float2 |
xy |
|
float2(int2)
Constructs a float2 vector from a int2 vector by componentwise conversion.
Declaration
Parameters
Type |
Name |
Description |
int2 |
v |
|
float2(uint2)
Constructs a float2 vector from a uint2 vector by componentwise conversion.
Declaration
Parameters
Type |
Name |
Description |
uint2 |
v |
|
Fields
x
Declaration
Field Value
Type |
Description |
System.Single |
|
y
Declaration
Field Value
Type |
Description |
System.Single |
|
zero
Declaration
public static readonly float2 zero
Field Value
Properties
Item[Int32]
Returns the float element at a specified index.
Declaration
public float this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Property Value
Type |
Description |
System.Single |
|
xx
Declaration
public float2 xx { get; }
Property Value
xxx
Declaration
public float3 xxx { get; }
Property Value
xxxx
Declaration
public float4 xxxx { get; }
Property Value
xxxy
Declaration
public float4 xxxy { get; }
Property Value
xxy
Declaration
public float3 xxy { get; }
Property Value
xxyx
Declaration
public float4 xxyx { get; }
Property Value
xxyy
Declaration
public float4 xxyy { get; }
Property Value
xy
Declaration
public float2 xy { get; set; }
Property Value
xyx
Declaration
public float3 xyx { get; }
Property Value
xyxx
Declaration
public float4 xyxx { get; }
Property Value
xyxy
Declaration
public float4 xyxy { get; }
Property Value
xyy
Declaration
public float3 xyy { get; }
Property Value
xyyx
Declaration
public float4 xyyx { get; }
Property Value
xyyy
Declaration
public float4 xyyy { get; }
Property Value
yx
Declaration
public float2 yx { get; set; }
Property Value
yxx
Declaration
public float3 yxx { get; }
Property Value
yxxx
Declaration
public float4 yxxx { get; }
Property Value
yxxy
Declaration
public float4 yxxy { get; }
Property Value
yxy
Declaration
public float3 yxy { get; }
Property Value
yxyx
Declaration
public float4 yxyx { get; }
Property Value
yxyy
Declaration
public float4 yxyy { get; }
Property Value
yy
Declaration
public float2 yy { get; }
Property Value
yyx
Declaration
public float3 yyx { get; }
Property Value
yyxx
Declaration
public float4 yyxx { get; }
Property Value
yyxy
Declaration
public float4 yyxy { get; }
Property Value
yyy
Declaration
public float3 yyy { get; }
Property Value
yyyx
Declaration
public float4 yyyx { get; }
Property Value
yyyy
Declaration
public float4 yyyy { get; }
Property Value
Methods
Equals(Object)
Returns true if the float2 is equal to a given float2, false otherwise.
Declaration
public override bool Equals(object o)
Parameters
Type |
Name |
Description |
System.Object |
o |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
Equals(float2)
Returns true if the float2 is equal to a given float2, false otherwise.
Declaration
public bool Equals(float2 rhs)
Parameters
Type |
Name |
Description |
float2 |
rhs |
|
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>.Equals(T)
GetHashCode()
Returns a hash code for the float2.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
ToString()
Returns a string representation of the float2.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
Returns a string representation of the float2 using a specified format and culture-specific format information.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type |
Name |
Description |
System.String |
format |
|
System.IFormatProvider |
formatProvider |
|
Returns
Type |
Description |
System.String |
|
Implements
System.IFormattable.ToString(System.String, System.IFormatProvider)
Operators
Addition(Single, float2)
Returns the result of a componentwise addition operation on a float value and a float2 vector.
Declaration
public static float2 operator +(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
Addition(float2, Single)
Returns the result of a componentwise addition operation on a float2 vector and a float value.
Declaration
public static float2 operator +(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
Addition(float2, float2)
Returns the result of a componentwise addition operation on two float2 vectors.
Declaration
public static float2 operator +(float2 lhs, float2 rhs)
Parameters
Returns
Decrement(float2)
Returns the result of a componentwise decrement operation on a float2 vector.
Declaration
public static float2 operator --(float2 val)
Parameters
Type |
Name |
Description |
float2 |
val |
|
Returns
Division(Single, float2)
Returns the result of a componentwise division operation on a float value and a float2 vector.
Declaration
public static float2 operator /(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
Division(float2, Single)
Returns the result of a componentwise division operation on a float2 vector and a float value.
Declaration
public static float2 operator /(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
Division(float2, float2)
Returns the result of a componentwise division operation on two float2 vectors.
Declaration
public static float2 operator /(float2 lhs, float2 rhs)
Parameters
Returns
Equality(Single, float2)
Returns the result of a componentwise equality operation on a float value and a float2 vector.
Declaration
public static bool2 operator ==(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
Equality(float2, Single)
Returns the result of a componentwise equality operation on a float2 vector and a float value.
Declaration
public static bool2 operator ==(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
Equality(float2, float2)
Returns the result of a componentwise equality operation on two float2 vectors.
Declaration
public static bool2 operator ==(float2 lhs, float2 rhs)
Parameters
Returns
Explicit(Boolean to float2)
Explicitly converts a single bool value to a float2 vector by converting it to float and assigning it to every component.
Declaration
public static explicit operator float2(bool v)
Parameters
Type |
Name |
Description |
System.Boolean |
v |
|
Returns
Explicit(Double to float2)
Explicitly converts a single double value to a float2 vector by converting it to float and assigning it to every component.
Declaration
public static explicit operator float2(double v)
Parameters
Type |
Name |
Description |
System.Double |
v |
|
Returns
Explicit(bool2 to float2)
Explicitly converts a bool2 vector to a float2 vector by componentwise conversion.
Declaration
public static explicit operator float2(bool2 v)
Parameters
Type |
Name |
Description |
bool2 |
v |
|
Returns
Explicit(double2 to float2)
Explicitly converts a double2 vector to a float2 vector by componentwise conversion.
Declaration
public static explicit operator float2(double2 v)
Parameters
Returns
GreaterThan(Single, float2)
Returns the result of a componentwise greater than operation on a float value and a float2 vector.
Declaration
public static bool2 operator>(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
GreaterThan(float2, Single)
Returns the result of a componentwise greater than operation on a float2 vector and a float value.
Declaration
public static bool2 operator>(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
GreaterThan(float2, float2)
Returns the result of a componentwise greater than operation on two float2 vectors.
Declaration
public static bool2 operator>(float2 lhs, float2 rhs)
Parameters
Returns
GreaterThanOrEqual(Single, float2)
Returns the result of a componentwise greater or equal operation on a float value and a float2 vector.
Declaration
public static bool2 operator >=(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
GreaterThanOrEqual(float2, Single)
Returns the result of a componentwise greater or equal operation on a float2 vector and a float value.
Declaration
public static bool2 operator >=(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
GreaterThanOrEqual(float2, float2)
Returns the result of a componentwise greater or equal operation on two float2 vectors.
Declaration
public static bool2 operator >=(float2 lhs, float2 rhs)
Parameters
Returns
Implicit(Int32 to float2)
Implicitly converts a single int value to a float2 vector by converting it to float and assigning it to every component.
Declaration
public static implicit operator float2(int v)
Parameters
Type |
Name |
Description |
System.Int32 |
v |
|
Returns
Implicit(Single to float2)
Implicitly converts a single float value to a float2 vector by assigning it to every component.
Declaration
public static implicit operator float2(float v)
Parameters
Type |
Name |
Description |
System.Single |
v |
|
Returns
Implicit(UInt32 to float2)
Implicitly converts a single uint value to a float2 vector by converting it to float and assigning it to every component.
Declaration
public static implicit operator float2(uint v)
Parameters
Type |
Name |
Description |
System.UInt32 |
v |
|
Returns
Implicit(float2 to Vector2)
Declaration
public static implicit operator Vector2(float2 v)
Parameters
Type |
Name |
Description |
float2 |
v |
|
Returns
Implicit(int2 to float2)
Implicitly converts a int2 vector to a float2 vector by componentwise conversion.
Declaration
public static implicit operator float2(int2 v)
Parameters
Type |
Name |
Description |
int2 |
v |
|
Returns
Implicit(uint2 to float2)
Implicitly converts a uint2 vector to a float2 vector by componentwise conversion.
Declaration
public static implicit operator float2(uint2 v)
Parameters
Type |
Name |
Description |
uint2 |
v |
|
Returns
Implicit(Vector2 to float2)
Declaration
public static implicit operator float2(Vector2 v)
Parameters
Type |
Name |
Description |
Vector2 |
v |
|
Returns
Increment(float2)
Returns the result of a componentwise increment operation on a float2 vector.
Declaration
public static float2 operator ++(float2 val)
Parameters
Type |
Name |
Description |
float2 |
val |
|
Returns
Inequality(Single, float2)
Returns the result of a componentwise not equal operation on a float value and a float2 vector.
Declaration
public static bool2 operator !=(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
Inequality(float2, Single)
Returns the result of a componentwise not equal operation on a float2 vector and a float value.
Declaration
public static bool2 operator !=(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
Inequality(float2, float2)
Returns the result of a componentwise not equal operation on two float2 vectors.
Declaration
public static bool2 operator !=(float2 lhs, float2 rhs)
Parameters
Returns
LessThan(Single, float2)
Returns the result of a componentwise less than operation on a float value and a float2 vector.
Declaration
public static bool2 operator <(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
LessThan(float2, Single)
Returns the result of a componentwise less than operation on a float2 vector and a float value.
Declaration
public static bool2 operator <(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
LessThan(float2, float2)
Returns the result of a componentwise less than operation on two float2 vectors.
Declaration
public static bool2 operator <(float2 lhs, float2 rhs)
Parameters
Returns
LessThanOrEqual(Single, float2)
Returns the result of a componentwise less or equal operation on a float value and a float2 vector.
Declaration
public static bool2 operator <=(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
LessThanOrEqual(float2, Single)
Returns the result of a componentwise less or equal operation on a float2 vector and a float value.
Declaration
public static bool2 operator <=(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
LessThanOrEqual(float2, float2)
Returns the result of a componentwise less or equal operation on two float2 vectors.
Declaration
public static bool2 operator <=(float2 lhs, float2 rhs)
Parameters
Returns
Modulus(Single, float2)
Returns the result of a componentwise modulus operation on a float value and a float2 vector.
Declaration
public static float2 operator %(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
Modulus(float2, Single)
Returns the result of a componentwise modulus operation on a float2 vector and a float value.
Declaration
public static float2 operator %(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
Modulus(float2, float2)
Returns the result of a componentwise modulus operation on two float2 vectors.
Declaration
public static float2 operator %(float2 lhs, float2 rhs)
Parameters
Returns
Multiply(Single, float2)
Returns the result of a componentwise multiplication operation on a float value and a float2 vector.
Declaration
public static float2 operator *(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
Multiply(float2, Single)
Returns the result of a componentwise multiplication operation on a float2 vector and a float value.
Declaration
public static float2 operator *(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
Multiply(float2, float2)
Returns the result of a componentwise multiplication operation on two float2 vectors.
Declaration
public static float2 operator *(float2 lhs, float2 rhs)
Parameters
Returns
Subtraction(Single, float2)
Returns the result of a componentwise subtraction operation on a float value and a float2 vector.
Declaration
public static float2 operator -(float lhs, float2 rhs)
Parameters
Type |
Name |
Description |
System.Single |
lhs |
|
float2 |
rhs |
|
Returns
Subtraction(float2, Single)
Returns the result of a componentwise subtraction operation on a float2 vector and a float value.
Declaration
public static float2 operator -(float2 lhs, float rhs)
Parameters
Type |
Name |
Description |
float2 |
lhs |
|
System.Single |
rhs |
|
Returns
Subtraction(float2, float2)
Returns the result of a componentwise subtraction operation on two float2 vectors.
Declaration
public static float2 operator -(float2 lhs, float2 rhs)
Parameters
Returns
UnaryNegation(float2)
Returns the result of a componentwise unary minus operation on a float2 vector.
Declaration
public static float2 operator -(float2 val)
Parameters
Type |
Name |
Description |
float2 |
val |
|
Returns
UnaryPlus(float2)
Returns the result of a componentwise unary plus operation on a float2 vector.
Declaration
public static float2 operator +(float2 val)
Parameters
Type |
Name |
Description |
float2 |
val |
|
Returns