Click or drag to resize

Vector2 Structure

A structure encapsulating two single precision doubling point values and provides hardware accelerated methods.

Namespace:  Karamba.Geometry
Assembly:  KarambaCommon (in KarambaCommon.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[SerializableAttribute]
public struct Vector2 : IEquatable<Vector2>, 
	IFormattable

The Vector2 type exposes the following members.

Constructors
  NameDescription
Public methodVector2(Double)
Constructs a vector whose elements are all the double specified value.
Public methodVector2(Double, Double)
Constructs a vector with the given individual elements.
Top
Properties
  NameDescription
Public propertyStatic memberOne
Returns the vector (1,1).
Public propertyStatic memberUnitX
Returns the vector (1,0).
Public propertyStatic memberUnitY
Returns the vector (0,1).
Public propertyStatic memberZero
Returns the vector (0,0).
Top
Methods
  NameDescription
Public methodStatic memberAbs
Returns a vector whose elements are the absolute values of each of the source vector's elements.
Public methodStatic memberAdd
Adds two vectors together.
Public methodStatic memberClamp
Restricts a vector between a min and max value.
Public methodStatic memberDistance
Returns the Euclidean distance between the two given points.
Public methodStatic memberDistanceSquared
Returns the Euclidean distance squared between the two given points.
Public methodStatic memberDivide(Vector2, Vector2)
Divides the first vector by the second.
Public methodStatic memberDivide(Vector2, Single)
Divides the vector by the given scalar.
Public methodStatic memberDot
Returns the dot product of two vectors.
Public methodEquals(Object)
Returns a boolean indicating whether the given Object is equal to this Vector2 instance.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Vector2)
Returns a boolean indicating whether the given Vector2 is equal to this Vector2 instance.
Public methodGetHashCode
Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLength
Returns the length of the vector.
Public methodLengthSquared
Returns the length of the vector squared. This operation is cheaper than Length().
Public methodStatic memberLerp
Linearly interpolates between two vectors based on the given weighting.
Public methodStatic memberMax
Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors
Public methodStatic memberMin
Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors.
Public methodStatic memberMultiply(Single, Vector2)
Multiplies a vector by the given scalar.
Public methodStatic memberMultiply(Vector2, Vector2)
Multiplies two vectors together.
Public methodStatic memberMultiply(Vector2, Single)
Multiplies a vector by the given scalar.
Public methodStatic memberNegate
Negates a given vector.
Public methodStatic memberNormalize
Returns a vector with the same direction as the given vector, but with a length of 1.
Public methodStatic memberReflect
Returns the reflection of a vector off a surface that has the specified normal.
Public methodStatic memberSquareRoot
Returns a vector whose elements are the square root of each of the source vector's elements.
Public methodStatic memberSubtract
Subtracts the second vector from the first.
Public methodToString
Returns a String representing this Vector2 instance.
(Overrides ValueTypeToString.)
Public methodToString(String)
Returns a String representing this Vector2 instance, using the specified format to format individual elements.
Public methodToString(String, IFormatProvider)
Returns a String representing this Vector2 instance, using the specified format to format individual elements and the given IFormatProvider.
Public methodStatic memberTransform(Vector2, Matrix3x2)
Transforms a vector by the given matrix.
Public methodStatic memberTransform(Vector2, Matrix4x4)
Transforms a vector by the given matrix.
Public methodStatic memberTransform(Vector2, Quaternion)
Transforms a vector by the given Quaternion rotation value.
Public methodStatic memberTransformNormal(Vector2, Matrix3x2)
Transforms a vector normal by the given matrix.
Public methodStatic memberTransformNormal(Vector2, Matrix4x4)
Transforms a vector normal by the given matrix.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Adds two vectors together.
Public operatorStatic memberDivision(Vector2, Vector2)
Divides the first vector by the second.
Public operatorStatic memberDivision(Vector2, Double)
Divides the vector by the given scalar.
Public operatorStatic memberEquality
Returns a boolean indicating whether the two given vectors are equal.
Public operatorStatic memberInequality
Returns a boolean indicating whether the two given vectors are not equal.
Public operatorStatic memberMultiply(Double, Vector2)
Multiplies a vector by the given scalar.
Public operatorStatic memberMultiply(Vector2, Vector2)
Multiplies two vectors together.
Public operatorStatic memberMultiply(Vector2, Double)
Multiplies a vector by the given scalar.
Public operatorStatic memberSubtraction
Subtracts the second vector from the first.
Public operatorStatic memberUnaryNegation
Negates a given vector.
Top
Fields
  NameDescription
Public fieldX
The X component of the vector.
Public fieldY
The Y component of the vector.
Top
See Also