Click or drag to resize

float2 Structure

Represents a 2D vector using two single-precision floating-point numbers.

Namespace:  Fusee.Math.Core
Assembly:  Fusee.Math.Core (in Fusee.Math.Core.dll) Version: 0.7.0.0 (0.1.0.0)
Syntax
C#
public struct float2 : IEquatable<float2>

The float2 type exposes the following members.

Constructors
  NameDescription
Public methodfloat2(float2) Obsolete.
Constructs a new float2 from the given float2.
Public methodfloat2(float3) Obsolete.
Constructs a new float2 from the given float3.
Public methodfloat2(float4) Obsolete.
Constructs a new float2 from the given float4.
Public methodfloat2(Single, Single)
Constructs a new float2.
Top
Properties
  NameDescription
Public propertyg
The green component (same as y)
Public propertyLength
Gets the length (magnitude) of the vector.
Public propertyLengthFast
Gets an approximation of the vector length (magnitude).
Public propertyLengthSquared
Gets the square of the vector length (magnitude).
Public propertyStatic memberParse
Gets or sets the Converter object. Has the ability to convert a string to a float2.
Public propertyPerpendicularLeft
Gets the perpendicular vector on the left side of this vector.
Public propertyPerpendicularRight
Gets the perpendicular vector on the right side of this vector.
Public propertyr
The red component (same as x)
Public propertyrg
The rg component (same as xy)
Public propertyxy
Gets or sets an OpenTK.float2 with the x and y components of this instance.
Top
Methods
  NameDescription
Public methodAdd(float2) Obsolete.
Add the Vector passed as parameter to this instance.
Public methodAdd(float2) Obsolete.
Add the Vector passed as parameter to this instance.
Public methodStatic memberAdd(float2, float2)
Adds two vectors.
Public methodStatic memberAdd(float2, float2, float2)
Adds two vectors.
Public methodStatic memberBarycentric
Interpolate 3 Vectors using Barycentric coordinates
Public methodStatic memberClamp(float2, float2, float2)
Clamp a vector to the given minimum and maximum vectors
Public methodStatic memberClamp(float2, float2, float2, float2)
Clamp a vector to the given minimum and maximum vectors
Public methodStatic memberComponentMax(float2, float2)
Calculate the component-wise maximum of two vectors
Public methodStatic memberComponentMax(float2, float2, float2)
Calculate the component-wise maximum of two vectors
Public methodStatic memberComponentMin(float2, float2)
Calculate the component-wise minimum of two vectors
Public methodStatic memberComponentMin(float2, float2, float2)
Calculate the component-wise minimum of two vectors
Public methodDiv(Single) Obsolete.
Divide this instance by a scalar.
Public methodStatic memberDiv(float2, Single) Obsolete.
Divide a vector by a scalar
Public methodStatic memberDiv(float2, Single, float2) Obsolete.
Divide a vector by a scalar
Public methodStatic memberDivide(float2, float2)
Divides a vector by the components of a vector (scale).
Public methodStatic memberDivide(float2, Single)
Divides a vector by a scalar.
Public methodStatic memberDivide(float2, float2, float2)
Divide a vector by the components of a vector (scale).
Public methodStatic memberDivide(float2, Single, float2)
Divides a vector by a scalar.
Public methodStatic memberDot(float2, float2)
Calculate the dot (scalar) product of two vectors
Public methodStatic memberDot(float2, float2, Single)
Calculate the dot (scalar) product of two vectors
Public methodEquals(Object)
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(float2)
Indicates whether the current vector is equal to another vector.
Public methodStatic memberGetBarycentric
Calculates the barycentric coordinates for the given point in the given triangle, such that u*a + v*b + (1-u-v)*c = point.
Public methodGetHashCode
Returns the hashcode for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIsTriangleCW
Checks if the three given 2D points form a clockwise (CW) triangle
Public methodStatic memberLerp(float2, float2, Single)
Returns a new Vector that is the linear blend of the 2 given Vectors
Public methodStatic memberLerp(float2, float2, Single, float2)
Returns a new Vector that is the linear blend of the 2 given Vectors
Public methodStatic memberMax
Returns the float3 with the minimum magnitude
Public methodStatic memberMin
Returns the float3 with the minimum magnitude
Public methodMult(Single) Obsolete.
Multiply this instance by a scalar.
Public methodStatic memberMult(float2, Single) Obsolete.
Multiply a vector and a scalar
Public methodStatic memberMult(float2, Single, float2) Obsolete.
Multiply a vector and a scalar
Public methodStatic memberMultiply(float2, float2)
Multiplies a vector by the components a vector (scale).
Public methodStatic memberMultiply(float2, Single)
Multiplies a vector by a scalar.
Public methodStatic memberMultiply(float2, float2, float2)
Multiplies a vector by the components of a vector (scale).
Public methodStatic memberMultiply(float2, Single, float2)
Multiplies a vector by a scalar.
Public methodNormalize
Scales the float2 to unit length.
Public methodStatic memberNormalize(float2)
Scale a vector to unit length
Public methodStatic memberNormalize(float2, float2)
Scale a vector to unit length
Public methodNormalizeFast
Scales the float2 to approximately unit length.
Public methodStatic memberNormalizeFast(float2)
Scale a vector to approximately unit length
Public methodStatic memberNormalizeFast(float2, float2)
Scale a vector to approximately unit length
Public methodStatic memberPointInTriangle
Checks if the give point is inside the given triangle (a, b, c). Returns the barycentric coordinates using GetBarycentric(float2, float2, float2, float2, Single, Single).
Public methodScale(float2) Obsolete.
Scales this instance by the given parameter.
Public methodScale(float2) Obsolete.
Scales this instance by the given parameter.
Public methodScale(Single, Single) Obsolete.
Scales the current float2 by the given amounts.
Public methodSub(float2) Obsolete.
Subtract the Vector passed as parameter from this instance.
Public methodSub(float2) Obsolete.
Subtract the Vector passed as parameter from this instance.
Public methodStatic memberSub(float2, float2) Obsolete.
Subtract one Vector from another
Public methodStatic memberSub(float2, float2, float2) Obsolete.
Subtract one Vector from another
Public methodStatic memberSubtract(float2, float2)
Subtract one Vector from another
Public methodStatic memberSubtract(float2, float2, float2)
Subtract one Vector from another
Public methodToArray
Returns an array of floats with the two components of the vector.
Public methodToString
Returns a System.String that represents the current float2.
(Overrides ValueTypeToString.)
Public methodStatic memberTransform(float2, Quaternion)
Transforms a vector by a quaternion rotation.
Public methodStatic memberTransform(float2, Quaternion, float2)
Transforms a vector by a quaternion rotation.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Adds the specified instances.
Public operatorStatic memberDivision
Divides the specified instance by a scalar.
Public operatorStatic memberEquality
Compares the specified instances for equality.
Public operatorStatic memberInequality
Compares the specified instances for inequality.
Public operatorStatic memberMultiply(Single, float2)
Multiplies the specified instance by a scalar.
Public operatorStatic memberMultiply(float2, float2)
Multiplies two instances.
Public operatorStatic memberMultiply(float2, Single)
Multiplies the specified instance by a scalar.
Public operatorStatic memberSubtraction
Subtracts the specified instances.
Public operatorStatic memberUnaryNegation
Negates the specified instance.
Top
Fields
  NameDescription
Public fieldStatic memberOne
Defines an instance with all components set to 1.
Public fieldStatic memberUnitX
Defines a unit-length float2 that points towards the x-axis.
Public fieldStatic memberUnitY
Defines a unit-length float2 that points towards the y-axis.
Public fieldx
The x component of the float2.
Public fieldy
The y component of the float2.
Public fieldStatic memberZero
Defines a zero-length float2.
Top
Remarks
The float2 structure is suitable for interoperation with unmanaged code requiring two consecutive floats.
See Also