.NET SDK Documentation

    Show / Hide Table of Contents

    Struct Vector2

    Represents a 2D Vector (type/units aren't specified)

    Implements
    IEquatable<Vector2>
    Namespace: Anki.Vector.Types
    Assembly: Anki.Vector.dll
    Syntax
    public struct Vector2 : IEquatable<Vector2>

    Constructors

    | Improve this Doc View Source

    Vector2(Single, Single)

    Initializes a new instance of the Vector2 struct.

    public Vector2(float x, float y)
    Parameters
    Type Name Description
    Single x

    The x.

    Single y

    The y.

    Properties

    | Improve this Doc View Source

    X

    Gets the x component

    public float X { get; }
    Property Type
    Single
    | Improve this Doc View Source

    Y

    Gets the y component

    public float Y { get; }
    Property Type
    Single

    Methods

    | Improve this Doc View Source

    Equals(Vector2)

    Indicates whether the current object is equal to another object of the same type.

    public bool Equals(Vector2 other)
    Parameters
    Type Name Description
    Vector2 other

    An object to compare with this object.

    Returns
    Type Description
    Boolean

    true if the current object is equal to the other parameter; otherwise, false.

    | Improve this Doc View Source

    Equals(Object)

    Determines whether the specified Object, is equal to this instance.

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

    The Object to compare with this instance.

    Returns
    Type Description
    Boolean

    true if the specified Object is equal to this instance; otherwise, false.

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

    GetHashCode()

    Returns a hash code for this instance.

    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

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

    ToString()

    Converts to string.

    public override string ToString()
    Returns
    Type Description
    String

    A String that represents this instance.

    Overrides
    ValueType.ToString()

    Operators

    | Improve this Doc View Source

    Addition(Vector2, Vector2)

    Implements the addition operator.

    public static Vector2 operator +(Vector2 lhs, Vector2 rhs)
    Parameters
    Type Name Description
    Vector2 lhs

    The left value.

    Vector2 rhs

    The right value.

    Returns
    Type Description
    Vector2

    Sum of 2 instances

    | Improve this Doc View Source

    Division(Vector2, Int32)

    Implements the division operator.

    public static Vector2 operator /(Vector2 vector, int value)
    Parameters
    Type Name Description
    Vector2 vector

    The Vector.

    Int32 value

    The value to divide by

    Returns
    Type Description
    Vector2

    The Vector divided by the value

    | Improve this Doc View Source

    Division(Vector2, Single)

    Implements the division operator.

    public static Vector2 operator /(Vector2 vector, float value)
    Parameters
    Type Name Description
    Vector2 vector

    The Vector.

    Single value

    The value to divide by

    Returns
    Type Description
    Vector2

    The Vector divided by the value

    | Improve this Doc View Source

    Equality(Vector2, Vector2)

    Implements the operator ==.

    public static bool operator ==(Vector2 lhs, Vector2 rhs)
    Parameters
    Type Name Description
    Vector2 lhs

    The LHS.

    Vector2 rhs

    The RHS.

    Returns
    Type Description
    Boolean

    The result of the operator.

    | Improve this Doc View Source

    Inequality(Vector2, Vector2)

    Implements the operator !=.

    public static bool operator !=(Vector2 lhs, Vector2 rhs)
    Parameters
    Type Name Description
    Vector2 lhs

    The LHS.

    Vector2 rhs

    The RHS.

    Returns
    Type Description
    Boolean

    The result of the operator.

    | Improve this Doc View Source

    Multiply(Vector2, Int32)

    Implements the multiplication operator.

    public static Vector2 operator *(Vector2 vector, int value)
    Parameters
    Type Name Description
    Vector2 vector

    The Vector.

    Int32 value

    The value to multiply by

    Returns
    Type Description
    Vector2

    The Vector multiplied by the value

    | Improve this Doc View Source

    Multiply(Vector2, Single)

    Implements the multiplication operator.

    public static Vector2 operator *(Vector2 vector, float value)
    Parameters
    Type Name Description
    Vector2 vector

    The Vector.

    Single value

    The value to multiply by

    Returns
    Type Description
    Vector2

    The Vector multiplied by the value

    | Improve this Doc View Source

    Subtraction(Vector2, Vector2)

    Implements the subtraction operator.

    public static Vector2 operator -(Vector2 lhs, Vector2 rhs)
    Parameters
    Type Name Description
    Vector2 lhs

    The left value.

    Vector2 rhs

    The right value.

    Returns
    Type Description
    Vector2

    Difference of 2 instances

    Implements

    System.IEquatable<T>
    • Improve this Doc
    • View Source
    Back to top Copyright (c) 2019 by Wayne Venables