Click or drag to resize
Vector2F Structure
2-dimensional float vector.

Namespace: Slash.Math.Algebra.Vectors
Assembly: Slash.Math (in Slash.Math.dll) Version: 1.0.6018.40177
Syntax
[SerializableAttribute]
public struct Vector2F

The Vector2F type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyIsNonZero
Indicates if at least one vector component is not zero.
Public propertyIsZero
Indicates if all vector components are zero.
Public propertyMagnitude
Magnitude of the vector.
Public propertySquareMagnitude
Square magnitude of the vector.
Top
Methods
  NameDescription
Public methodStatic memberAbs
Returns a vector whose components represent the absolute values of the components of the specified vector.
Public methodAdd
Adds the passed values to the x and y value.
Public methodStatic memberArea
Returns a positive number if c is to the left of the line going from a to b.
Public methodStatic memberCalculateAngle
Calculates the angle between two vectors on a plane.
Public methodCalculateDotProduct
Calculates the dot product of this and the passed vector. See http://en.wikipedia.org/wiki/Dot_product for more details.
Public methodStatic memberCollinear(Vector2F, Vector2F, Vector2F)
Determines if three vectors are collinear (ie. on a straight line).
Public methodStatic memberCollinear(Vector2F, Vector2F, Vector2F, Single)
Determines if three vectors are collinear (ie. on a straight line).
Public methodStatic memberCross
Calculates the cross product of the two passed vectors. See http://en.wikipedia.org/wiki/Cross_product for more details.
Public methodStatic memberDistance
Returns the distance between the two passed vectors.
Public methodStatic memberDot
Calculates the dot product of the two passed vectors. See http://en.wikipedia.org/wiki/Dot_product for more details.
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Vector2F)
Determines whether the specified Vector2F is equal to the current Vector2F.
Public methodGetDistance
Calculates the distance between this and the passed vector.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Overrides ValueTypeGetHashCode.)
Public methodGetNormalized
Returns the normalized vector.
Public methodGetPerpendicularVector
Returns a vector which is perpendicular to this vector.
Public methodGetReflected
Creates a new vector which is reflected by the specified vector.
Public methodGetSquareDistance
Calculates the square distance between this and the passed vector.
Public methodIsParallel
Checks if this vector is parallel or anti-parallel to the passed one.
Public methodLimit
Creates a new vector which is limited to the specified length. If the vector is longer it is truncated, otherwise it stays the same.
Public methodStatic memberMax
Creates a new vector out of the two passed vectors and takes the maximum values from these for each component.
Public methodStatic memberMin
Creates a new vector out of the two passed vectors and takes the minimum values from these for each component.
Public methodNormalize
Normalizes this vector.
Public methodRotate
Rotates the vector counter-clockwise.
Public methodStatic memberSlerp
Spherically interpolates between the two passed vectors.
Public methodToString
Returns a string that represents the current object.
(Overrides ValueTypeToString.)
Public methodTruncate
Changes the magnitude of this vector to the passed value.
Top
Operators
  NameDescription
Public operatorStatic memberAddition(Vector2F, Vector2F)
Sums the components of the passed vectors and returns the resulting vector.
Public operatorStatic memberAddition(Vector2F, Single)
Adds the passed float value to each component of the passed vector.
Public operatorStatic memberDivision
Divides each component of the passed vector by the passed value.
Public operatorStatic memberEquality
Indicates if the two passed vectors are equal.
Public operatorStatic memberInequality
Indicates if the two passed vectors are not equal.
Public operatorStatic memberMultiply(Single, Vector2F)
Multiplies each vector component with the passed float value.
Public operatorStatic memberMultiply(Vector2F, Vector2F)
Multiplies each vector component of the two passed vectors.
Public operatorStatic memberMultiply(Vector2F, Single)
Multiplies each vector component with the passed float value.
Public operatorStatic memberSubtraction(Vector2F, Vector2F)
Subtracts the components of the second passed vector from the first passed.
Public operatorStatic memberSubtraction(Vector2F, Single)
Subtracts the passed float value from each component of the passed vector.
Public operatorStatic memberUnaryNegation
Negates each component of the passed vector.
Top
Fields
  NameDescription
Public fieldStatic memberForward
Unrotated forward vector.
Public fieldStatic memberMinusOne
Both vector components are -1.
Public fieldStatic memberOne
Both vector components are 1.
Public fieldStatic memberSide
Unrotated side vector.
Public fieldStatic memberSideAngle
Angle to transform forward to side vector.
Public fieldStatic memberUnitX
X component is 1, Y component is 0.
Public fieldStatic memberUnitY
X component is 0, Y component is 1.
Public fieldX
X component.
Public fieldY
Y component.
Public fieldStatic memberZero
Both vector components are 0.
Top
Extension Methods
  NameDescription
Public Extension MethodToVector2
Converts the specified framework vector to an Unity vector.
(Defined by MathConversionExtensions.)
Public Extension MethodToVector3
Converts the specified framework vector to an Unity vector.
(Defined by MathConversionExtensions.)
Public Extension MethodToVector3F
Returns the 3D representation of this 2D vector and z coordinate.
(Defined by VectorExtensions.)
Public Extension MethodToVector3XY
Converts the specified framework vector to an Unity vector.
(Defined by MathConversionExtensions.)
Public Extension MethodToVector3XZ
Converts the specified framework vector to an Unity vector.
(Defined by MathConversionExtensions.)
Top
See Also