Search Results for

    Show / Hide Table of Contents

    Struct Vector4

    A structure encapsulating four doublevalues and provides hardware accelerated methods.

    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: System.Numerics
    Assembly: System.Numerics.dll
    Syntax
    public struct Vector4

    Constructors

    | Improve this Doc View Source

    Vector4(Double)

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

    Declaration
    public Vector4(double value)
    Parameters
    Type Name Description
    Double value

    The element to fill the vector with.

    | Improve this Doc View Source

    Vector4(Double, Double, Double, Double)

    Constructs a vector with the given individual elements.

    Declaration
    public Vector4(double x, double y, double z, double w)
    Parameters
    Type Name Description
    Double x

    X component.

    Double y

    Y component.

    Double z

    Z component.

    Double w

    W component.

    | Improve this Doc View Source

    Vector4(Vector2, Double, Double)

    Constructs a Vector4 from the given Vector2 and a Z and W component.

    Declaration
    public Vector4(Vector2 value, double z, double w)
    Parameters
    Type Name Description
    Vector2 value

    The vector to use as the X and Y components.

    Double z

    The Z component.

    Double w

    The W component.

    | Improve this Doc View Source

    Vector4(Vector3, Double)

    Constructs a Vector4 from the given Vector3 and a W component.

    Declaration
    public Vector4(Vector3 value, double w)
    Parameters
    Type Name Description
    Vector3 value

    The vector to use as the X, Y, and Z components.

    Double w

    The W component.

    Fields

    | Improve this Doc View Source

    W

    The W component of the vector.

    Declaration
    public double W
    Field Value
    Type Description
    Double
    | Improve this Doc View Source

    X

    The X component of the vector.

    Declaration
    public double X
    Field Value
    Type Description
    Double
    | Improve this Doc View Source

    Y

    The Y component of the vector.

    Declaration
    public double Y
    Field Value
    Type Description
    Double
    | Improve this Doc View Source

    Z

    The Z component of the vector.

    Declaration
    public double Z
    Field Value
    Type Description
    Double

    Properties

    | Improve this Doc View Source

    One

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

    Declaration
    public static readonly Vector4 One { get; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    UnitW

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

    Declaration
    public static readonly Vector4 UnitW { get; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    UnitX

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

    Declaration
    public static readonly Vector4 UnitX { get; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    UnitY

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

    Declaration
    public static readonly Vector4 UnitY { get; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    UnitZ

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

    Declaration
    public static readonly Vector4 UnitZ { get; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zero

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

    Declaration
    public static readonly Vector4 Zero { get; }
    Property Value
    Type Description
    Vector4

    Methods

    | Improve this Doc View Source

    Abs(Vector4)

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

    Declaration
    public static Vector4 Abs(Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

    The source vector.

    Returns
    Type Description
    Vector4

    The absolute value vector.

    | Improve this Doc View Source

    Add(Vector4, Vector4)

    Adds two vectors together.

    Declaration
    public static Vector4 Add(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The summed vector.

    | Improve this Doc View Source

    Clamp(Vector4, Vector4, Vector4)

    Restricts a vector between a min and max value.

    Declaration
    public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max)
    Parameters
    Type Name Description
    Vector4 value1

    The source vector.

    Vector4 min

    The minimum value.

    Vector4 max

    The maximum value.

    Returns
    Type Description
    Vector4

    The restricted vector.

    | Improve this Doc View Source

    CopyTo(Double[])

    Copies the contents of the vector into the given array.

    Declaration
    public void CopyTo(double[] array)
    Parameters
    Type Name Description
    Double[] array
    | Improve this Doc View Source

    CopyTo(Double[], Int32)

    Copies the contents of the vector into the given array, starting from index.

    Declaration
    public void CopyTo(double[] array, int index)
    Parameters
    Type Name Description
    Double[] array
    Int32 index
    Exceptions
    Type Condition
    ArgumentNullException

    If array is null.

    ArgumentOutOfRangeException

    If index is greater than end of the array or index is less than zero.

    ArgumentException

    If number of elements in source vector is greater than those available in destination array.

    | Improve this Doc View Source

    Distance(Vector4, Vector4)

    Returns the Euclidean distance between the two given points.

    Declaration
    public static double Distance(Vector4 value1, Vector4 value2)
    Parameters
    Type Name Description
    Vector4 value1

    The first point.

    Vector4 value2

    The second point.

    Returns
    Type Description
    Double

    The distance.

    | Improve this Doc View Source

    DistanceSquared(Vector4, Vector4)

    Returns the Euclidean distance squared between the two given points.

    Declaration
    public static double DistanceSquared(Vector4 value1, Vector4 value2)
    Parameters
    Type Name Description
    Vector4 value1

    The first point.

    Vector4 value2

    The second point.

    Returns
    Type Description
    Double

    The distance squared.

    | Improve this Doc View Source

    Divide(Vector4, Double)

    Divides the vector by the given scalar.

    Declaration
    public static Vector4 Divide(Vector4 left, double divisor)
    Parameters
    Type Name Description
    Vector4 left

    The source vector.

    Double divisor

    The scalar value.

    Returns
    Type Description
    Vector4

    The result of the division.

    | Improve this Doc View Source

    Divide(Vector4, Vector4)

    Divides the first vector by the second.

    Declaration
    public static Vector4 Divide(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The vector resulting from the division.

    | Improve this Doc View Source

    Dot(Vector4, Vector4)

    Returns the dot product of two vectors.

    Declaration
    public static double Dot(Vector4 vector1, Vector4 vector2)
    Parameters
    Type Name Description
    Vector4 vector1

    The first vector.

    Vector4 vector2

    The second vector.

    Returns
    Type Description
    Double

    The dot product.

    | Improve this Doc View Source

    Equals(Vector4)

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

    Declaration
    public bool Equals(Vector4 other)
    Parameters
    Type Name Description
    Vector4 other

    The Vector4 to compare this instance to.

    Returns
    Type Description
    Boolean

    True if the other Vector4 is equal to this instance; False otherwise.

    | Improve this Doc View Source

    Equals(Object)

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

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The Object to compare against.

    Returns
    Type Description
    Boolean

    True if the Object is equal to this Vector4; False otherwise.

    Overrides
    ValueType.Equals(Object)
    | Improve this Doc View Source

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    The hash code.

    Overrides
    Object.GetHashCode()
    | Improve this Doc View Source

    Length()

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

    Declaration
    public double Length()
    Returns
    Type Description
    Double

    The vector's length.

    | Improve this Doc View Source

    LengthSquared()

    Returns the length of the vector squared.

    Declaration
    public double LengthSquared()
    Returns
    Type Description
    Double

    The vector's length squared.

    | Improve this Doc View Source

    Lerp(Vector4, Vector4, Double)

    Linearly interpolates between two vectors based on the given weighting.

    Declaration
    public static Vector4 Lerp(Vector4 value1, Vector4 value2, double amount)
    Parameters
    Type Name Description
    Vector4 value1

    The first source vector.

    Vector4 value2

    The second source vector.

    Double amount

    Value between 0 and 1 indicating the weight of the second source vector.

    Returns
    Type Description
    Vector4

    The interpolated vector.

    | Improve this Doc View Source

    Max(Vector4, Vector4)

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

    Declaration
    public static Vector4 Max(Vector4 value1, Vector4 value2)
    Parameters
    Type Name Description
    Vector4 value1

    The first source vector.

    Vector4 value2

    The second source vector.

    Returns
    Type Description
    Vector4

    The maximized vector.

    | Improve this Doc View Source

    Min(Vector4, Vector4)

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

    Declaration
    public static Vector4 Min(Vector4 value1, Vector4 value2)
    Parameters
    Type Name Description
    Vector4 value1

    The first source vector.

    Vector4 value2

    The second source vector.

    Returns
    Type Description
    Vector4

    The minimized vector.

    | Improve this Doc View Source

    Multiply(Double, Vector4)

    Multiplies a vector by the given scalar.

    Declaration
    public static Vector4 Multiply(double left, Vector4 right)
    Parameters
    Type Name Description
    Double left

    The scalar value.

    Vector4 right

    The source vector.

    Returns
    Type Description
    Vector4

    The scaled vector.

    | Improve this Doc View Source

    Multiply(Vector4, Double)

    Multiplies a vector by the given scalar.

    Declaration
    public static Vector4 Multiply(Vector4 left, double right)
    Parameters
    Type Name Description
    Vector4 left

    The source vector.

    Double right

    The scalar value.

    Returns
    Type Description
    Vector4

    The scaled vector.

    | Improve this Doc View Source

    Multiply(Vector4, Vector4)

    Multiplies two vectors together.

    Declaration
    public static Vector4 Multiply(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The product vector.

    | Improve this Doc View Source

    Negate(Vector4)

    Negates a given vector.

    Declaration
    public static Vector4 Negate(Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

    The source vector.

    Returns
    Type Description
    Vector4

    The negated vector.

    | Improve this Doc View Source

    Normalize(Vector4)

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

    Declaration
    public static Vector4 Normalize(Vector4 vector)
    Parameters
    Type Name Description
    Vector4 vector

    The vector to normalize.

    Returns
    Type Description
    Vector4

    The normalized vector.

    | Improve this Doc View Source

    SquareRoot(Vector4)

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

    Declaration
    public static Vector4 SquareRoot(Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

    The source vector.

    Returns
    Type Description
    Vector4

    The square root vector.

    | Improve this Doc View Source

    Subtract(Vector4, Vector4)

    Subtracts the second vector from the first.

    Declaration
    public static Vector4 Subtract(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The difference vector.

    | Improve this Doc View Source

    ToString()

    Returns a String representing this Vector4 instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    The string representation.

    Overrides
    Object.ToString()
    | Improve this Doc View Source

    Transform(Vector2, Quaternion)

    Transforms a vector by the given Quaternion rotation value.

    Declaration
    public static Vector4 Transform(Vector2 value, Quaternion rotation)
    Parameters
    Type Name Description
    Vector2 value

    The source vector to be rotated.

    Quaternion rotation

    The rotation to apply.

    Returns
    Type Description
    Vector4

    The transformed vector.

    | Improve this Doc View Source

    Transform(Vector3, Quaternion)

    Transforms a vector by the given Quaternion rotation value.

    Declaration
    public static Vector4 Transform(Vector3 value, Quaternion rotation)
    Parameters
    Type Name Description
    Vector3 value

    The source vector to be rotated.

    Quaternion rotation

    The rotation to apply.

    Returns
    Type Description
    Vector4

    The transformed vector.

    | Improve this Doc View Source

    Transform(Vector4, Quaternion)

    Transforms a vector by the given Quaternion rotation value.

    Declaration
    public static Vector4 Transform(Vector4 value, Quaternion rotation)
    Parameters
    Type Name Description
    Vector4 value

    The source vector to be rotated.

    Quaternion rotation

    The rotation to apply.

    Returns
    Type Description
    Vector4

    The transformed vector.

    Operators

    | Improve this Doc View Source

    Addition(Vector4, Vector4)

    Adds two vectors together.

    Declaration
    public static Vector4 operator +(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The summed vector.

    | Improve this Doc View Source

    Division(Vector4, Double)

    Divides the vector by the given scalar.

    Declaration
    public static Vector4 operator /(Vector4 value1, double value2)
    Parameters
    Type Name Description
    Vector4 value1

    The source vector.

    Double value2

    The scalar value.

    Returns
    Type Description
    Vector4

    The result of the division.

    | Improve this Doc View Source

    Division(Vector4, Vector4)

    Divides the first vector by the second.

    Declaration
    public static Vector4 operator /(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The vector resulting from the division.

    | Improve this Doc View Source

    Equality(Vector4, Vector4)

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

    Declaration
    public static bool operator ==(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first vector to compare.

    Vector4 right

    The second vector to compare.

    Returns
    Type Description
    Boolean

    True if the vectors are equal; False otherwise.

    | Improve this Doc View Source

    Inequality(Vector4, Vector4)

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

    Declaration
    public static bool operator !=(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first vector to compare.

    Vector4 right

    The second vector to compare.

    Returns
    Type Description
    Boolean

    True if the vectors are not equal; False if they are equal.

    | Improve this Doc View Source

    Multiply(Double, Vector4)

    Multiplies a vector by the given scalar.

    Declaration
    public static Vector4 operator *(double left, Vector4 right)
    Parameters
    Type Name Description
    Double left

    The scalar value.

    Vector4 right

    The source vector.

    Returns
    Type Description
    Vector4

    The scaled vector.

    | Improve this Doc View Source

    Multiply(Vector4, Double)

    Multiplies a vector by the given scalar.

    Declaration
    public static Vector4 operator *(Vector4 left, double right)
    Parameters
    Type Name Description
    Vector4 left

    The source vector.

    Double right

    The scalar value.

    Returns
    Type Description
    Vector4

    The scaled vector.

    | Improve this Doc View Source

    Multiply(Vector4, Vector4)

    Multiplies two vectors together.

    Declaration
    public static Vector4 operator *(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The product vector.

    | Improve this Doc View Source

    Subtraction(Vector4, Vector4)

    Subtracts the second vector from the first.

    Declaration
    public static Vector4 operator -(Vector4 left, Vector4 right)
    Parameters
    Type Name Description
    Vector4 left

    The first source vector.

    Vector4 right

    The second source vector.

    Returns
    Type Description
    Vector4

    The difference vector.

    | Improve this Doc View Source

    UnaryNegation(Vector4)

    Negates a given vector.

    Declaration
    public static Vector4 operator -(Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

    The source vector.

    Returns
    Type Description
    Vector4

    The negated vector.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX