Struct float2x2 | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct float2x2

    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: Unity.Mathematics
    Syntax
    [Serializable]
    public struct float2x2 : IEquatable<float2x2>, IFormattable

    Constructors

    float2x2(Boolean)

    Constructs a float2x2 matrix from a single bool value by converting it to float and assigning it to every component.

    Declaration
    public float2x2(bool v)
    Parameters
    Type Name Description
    System.Boolean v

    float2x2(Double)

    Constructs a float2x2 matrix from a single double value by converting it to float and assigning it to every component.

    Declaration
    public float2x2(double v)
    Parameters
    Type Name Description
    System.Double v

    float2x2(Int32)

    Constructs a float2x2 matrix from a single int value by converting it to float and assigning it to every component.

    Declaration
    public float2x2(int v)
    Parameters
    Type Name Description
    System.Int32 v

    float2x2(Single)

    Constructs a float2x2 matrix from a single float value by assigning it to every component.

    Declaration
    public float2x2(float v)
    Parameters
    Type Name Description
    System.Single v

    float2x2(Single, Single, Single, Single)

    Constructs a float2x2 matrix from 4 float values given in row-major order.

    Declaration
    public float2x2(float m00, float m01, float m10, float m11)
    Parameters
    Type Name Description
    System.Single m00
    System.Single m01
    System.Single m10
    System.Single m11

    float2x2(UInt32)

    Constructs a float2x2 matrix from a single uint value by converting it to float and assigning it to every component.

    Declaration
    public float2x2(uint v)
    Parameters
    Type Name Description
    System.UInt32 v

    float2x2(bool2x2)

    Constructs a float2x2 matrix from a bool2x2 matrix by componentwise conversion.

    Declaration
    public float2x2(bool2x2 v)
    Parameters
    Type Name Description
    bool2x2 v

    float2x2(double2x2)

    Constructs a float2x2 matrix from a double2x2 matrix by componentwise conversion.

    Declaration
    public float2x2(double2x2 v)
    Parameters
    Type Name Description
    double2x2 v

    float2x2(float2, float2)

    Constructs a float2x2 matrix from two float2 vectors.

    Declaration
    public float2x2(float2 c0, float2 c1)
    Parameters
    Type Name Description
    float2 c0
    float2 c1

    float2x2(int2x2)

    Constructs a float2x2 matrix from a int2x2 matrix by componentwise conversion.

    Declaration
    public float2x2(int2x2 v)
    Parameters
    Type Name Description
    int2x2 v

    float2x2(uint2x2)

    Constructs a float2x2 matrix from a uint2x2 matrix by componentwise conversion.

    Declaration
    public float2x2(uint2x2 v)
    Parameters
    Type Name Description
    uint2x2 v

    Fields

    c0

    Declaration
    public float2 c0
    Field Value
    Type Description
    float2

    c1

    Declaration
    public float2 c1
    Field Value
    Type Description
    float2

    identity

    float2x2 identity transform.

    Declaration
    public static readonly float2x2 identity
    Field Value
    Type Description
    float2x2

    zero

    float2x2 zero value.

    Declaration
    public static readonly float2x2 zero
    Field Value
    Type Description
    float2x2

    Properties

    Item[Int32]

    Returns the float2 element at a specified index.

    Declaration
    public float2 this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    float2

    Methods

    Equals(Object)

    Returns true if the float2x2 is equal to a given float2x2, false otherwise.

    Declaration
    public override bool Equals(object o)
    Parameters
    Type Name Description
    System.Object o
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    Equals(float2x2)

    Returns true if the float2x2 is equal to a given float2x2, false otherwise.

    Declaration
    public bool Equals(float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 rhs
    Returns
    Type Description
    System.Boolean
    Implements
    System.IEquatable<T>.Equals(T)

    GetHashCode()

    Returns a hash code for the float2x2.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    Rotate(Single)

    Returns a float2x2 matrix representing a counter-clockwise rotation of angle degrees.

    Declaration
    public static float2x2 Rotate(float angle)
    Parameters
    Type Name Description
    System.Single angle
    Returns
    Type Description
    float2x2

    Scale(Single)

    Returns a float2x2 matrix representing a uniform scaling of both axes by s.

    Declaration
    public static float2x2 Scale(float s)
    Parameters
    Type Name Description
    System.Single s
    Returns
    Type Description
    float2x2

    Scale(Single, Single)

    Returns a float2x2 matrix representing a non-uniform axis scaling by x and y.

    Declaration
    public static float2x2 Scale(float x, float y)
    Parameters
    Type Name Description
    System.Single x
    System.Single y
    Returns
    Type Description
    float2x2

    Scale(float2)

    Returns a float2x2 matrix representing a non-uniform axis scaling by the components of the float2 vector v.

    Declaration
    public static float2x2 Scale(float2 v)
    Parameters
    Type Name Description
    float2 v
    Returns
    Type Description
    float2x2

    ToString()

    Returns a string representation of the float2x2.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()

    ToString(String, IFormatProvider)

    Returns a string representation of the float2x2 using a specified format and culture-specific format information.

    Declaration
    public string ToString(string format, IFormatProvider formatProvider)
    Parameters
    Type Name Description
    System.String format
    System.IFormatProvider formatProvider
    Returns
    Type Description
    System.String
    Implements
    System.IFormattable.ToString(System.String, System.IFormatProvider)

    Operators

    Addition(Single, float2x2)

    Returns the result of a componentwise addition operation on a float value and a float2x2 matrix.

    Declaration
    public static float2x2 operator +(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Addition(float2x2, Single)

    Returns the result of a componentwise addition operation on a float2x2 matrix and a float value.

    Declaration
    public static float2x2 operator +(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    float2x2

    Addition(float2x2, float2x2)

    Returns the result of a componentwise addition operation on two float2x2 matrices.

    Declaration
    public static float2x2 operator +(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Decrement(float2x2)

    Returns the result of a componentwise decrement operation on a float2x2 matrix.

    Declaration
    public static float2x2 operator --(float2x2 val)
    Parameters
    Type Name Description
    float2x2 val
    Returns
    Type Description
    float2x2

    Division(Single, float2x2)

    Returns the result of a componentwise division operation on a float value and a float2x2 matrix.

    Declaration
    public static float2x2 operator /(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Division(float2x2, Single)

    Returns the result of a componentwise division operation on a float2x2 matrix and a float value.

    Declaration
    public static float2x2 operator /(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    float2x2

    Division(float2x2, float2x2)

    Returns the result of a componentwise division operation on two float2x2 matrices.

    Declaration
    public static float2x2 operator /(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Equality(Single, float2x2)

    Returns the result of a componentwise equality operation on a float value and a float2x2 matrix.

    Declaration
    public static bool2x2 operator ==(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    Equality(float2x2, Single)

    Returns the result of a componentwise equality operation on a float2x2 matrix and a float value.

    Declaration
    public static bool2x2 operator ==(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    bool2x2

    Equality(float2x2, float2x2)

    Returns the result of a componentwise equality operation on two float2x2 matrices.

    Declaration
    public static bool2x2 operator ==(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    Explicit(Boolean to float2x2)

    Explicitly converts a single bool value to a float2x2 matrix by converting it to float and assigning it to every component.

    Declaration
    public static explicit operator float2x2(bool v)
    Parameters
    Type Name Description
    System.Boolean v
    Returns
    Type Description
    float2x2

    Explicit(Double to float2x2)

    Explicitly converts a single double value to a float2x2 matrix by converting it to float and assigning it to every component.

    Declaration
    public static explicit operator float2x2(double v)
    Parameters
    Type Name Description
    System.Double v
    Returns
    Type Description
    float2x2

    Explicit(bool2x2 to float2x2)

    Explicitly converts a bool2x2 matrix to a float2x2 matrix by componentwise conversion.

    Declaration
    public static explicit operator float2x2(bool2x2 v)
    Parameters
    Type Name Description
    bool2x2 v
    Returns
    Type Description
    float2x2

    Explicit(double2x2 to float2x2)

    Explicitly converts a double2x2 matrix to a float2x2 matrix by componentwise conversion.

    Declaration
    public static explicit operator float2x2(double2x2 v)
    Parameters
    Type Name Description
    double2x2 v
    Returns
    Type Description
    float2x2

    GreaterThan(Single, float2x2)

    Returns the result of a componentwise greater than operation on a float value and a float2x2 matrix.

    Declaration
    public static bool2x2 operator>(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    GreaterThan(float2x2, Single)

    Returns the result of a componentwise greater than operation on a float2x2 matrix and a float value.

    Declaration
    public static bool2x2 operator>(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    bool2x2

    GreaterThan(float2x2, float2x2)

    Returns the result of a componentwise greater than operation on two float2x2 matrices.

    Declaration
    public static bool2x2 operator>(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    GreaterThanOrEqual(Single, float2x2)

    Returns the result of a componentwise greater or equal operation on a float value and a float2x2 matrix.

    Declaration
    public static bool2x2 operator >=(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    GreaterThanOrEqual(float2x2, Single)

    Returns the result of a componentwise greater or equal operation on a float2x2 matrix and a float value.

    Declaration
    public static bool2x2 operator >=(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    bool2x2

    GreaterThanOrEqual(float2x2, float2x2)

    Returns the result of a componentwise greater or equal operation on two float2x2 matrices.

    Declaration
    public static bool2x2 operator >=(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    Implicit(Int32 to float2x2)

    Implicitly converts a single int value to a float2x2 matrix by converting it to float and assigning it to every component.

    Declaration
    public static implicit operator float2x2(int v)
    Parameters
    Type Name Description
    System.Int32 v
    Returns
    Type Description
    float2x2

    Implicit(Single to float2x2)

    Implicitly converts a single float value to a float2x2 matrix by assigning it to every component.

    Declaration
    public static implicit operator float2x2(float v)
    Parameters
    Type Name Description
    System.Single v
    Returns
    Type Description
    float2x2

    Implicit(UInt32 to float2x2)

    Implicitly converts a single uint value to a float2x2 matrix by converting it to float and assigning it to every component.

    Declaration
    public static implicit operator float2x2(uint v)
    Parameters
    Type Name Description
    System.UInt32 v
    Returns
    Type Description
    float2x2

    Implicit(int2x2 to float2x2)

    Implicitly converts a int2x2 matrix to a float2x2 matrix by componentwise conversion.

    Declaration
    public static implicit operator float2x2(int2x2 v)
    Parameters
    Type Name Description
    int2x2 v
    Returns
    Type Description
    float2x2

    Implicit(uint2x2 to float2x2)

    Implicitly converts a uint2x2 matrix to a float2x2 matrix by componentwise conversion.

    Declaration
    public static implicit operator float2x2(uint2x2 v)
    Parameters
    Type Name Description
    uint2x2 v
    Returns
    Type Description
    float2x2

    Increment(float2x2)

    Returns the result of a componentwise increment operation on a float2x2 matrix.

    Declaration
    public static float2x2 operator ++(float2x2 val)
    Parameters
    Type Name Description
    float2x2 val
    Returns
    Type Description
    float2x2

    Inequality(Single, float2x2)

    Returns the result of a componentwise not equal operation on a float value and a float2x2 matrix.

    Declaration
    public static bool2x2 operator !=(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    Inequality(float2x2, Single)

    Returns the result of a componentwise not equal operation on a float2x2 matrix and a float value.

    Declaration
    public static bool2x2 operator !=(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    bool2x2

    Inequality(float2x2, float2x2)

    Returns the result of a componentwise not equal operation on two float2x2 matrices.

    Declaration
    public static bool2x2 operator !=(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    LessThan(Single, float2x2)

    Returns the result of a componentwise less than operation on a float value and a float2x2 matrix.

    Declaration
    public static bool2x2 operator <(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    LessThan(float2x2, Single)

    Returns the result of a componentwise less than operation on a float2x2 matrix and a float value.

    Declaration
    public static bool2x2 operator <(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    bool2x2

    LessThan(float2x2, float2x2)

    Returns the result of a componentwise less than operation on two float2x2 matrices.

    Declaration
    public static bool2x2 operator <(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    LessThanOrEqual(Single, float2x2)

    Returns the result of a componentwise less or equal operation on a float value and a float2x2 matrix.

    Declaration
    public static bool2x2 operator <=(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    LessThanOrEqual(float2x2, Single)

    Returns the result of a componentwise less or equal operation on a float2x2 matrix and a float value.

    Declaration
    public static bool2x2 operator <=(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    bool2x2

    LessThanOrEqual(float2x2, float2x2)

    Returns the result of a componentwise less or equal operation on two float2x2 matrices.

    Declaration
    public static bool2x2 operator <=(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    bool2x2

    Modulus(Single, float2x2)

    Returns the result of a componentwise modulus operation on a float value and a float2x2 matrix.

    Declaration
    public static float2x2 operator %(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Modulus(float2x2, Single)

    Returns the result of a componentwise modulus operation on a float2x2 matrix and a float value.

    Declaration
    public static float2x2 operator %(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    float2x2

    Modulus(float2x2, float2x2)

    Returns the result of a componentwise modulus operation on two float2x2 matrices.

    Declaration
    public static float2x2 operator %(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Multiply(Single, float2x2)

    Returns the result of a componentwise multiplication operation on a float value and a float2x2 matrix.

    Declaration
    public static float2x2 operator *(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Multiply(float2x2, Single)

    Returns the result of a componentwise multiplication operation on a float2x2 matrix and a float value.

    Declaration
    public static float2x2 operator *(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    float2x2

    Multiply(float2x2, float2x2)

    Returns the result of a componentwise multiplication operation on two float2x2 matrices.

    Declaration
    public static float2x2 operator *(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Subtraction(Single, float2x2)

    Returns the result of a componentwise subtraction operation on a float value and a float2x2 matrix.

    Declaration
    public static float2x2 operator -(float lhs, float2x2 rhs)
    Parameters
    Type Name Description
    System.Single lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    Subtraction(float2x2, Single)

    Returns the result of a componentwise subtraction operation on a float2x2 matrix and a float value.

    Declaration
    public static float2x2 operator -(float2x2 lhs, float rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    System.Single rhs
    Returns
    Type Description
    float2x2

    Subtraction(float2x2, float2x2)

    Returns the result of a componentwise subtraction operation on two float2x2 matrices.

    Declaration
    public static float2x2 operator -(float2x2 lhs, float2x2 rhs)
    Parameters
    Type Name Description
    float2x2 lhs
    float2x2 rhs
    Returns
    Type Description
    float2x2

    UnaryNegation(float2x2)

    Returns the result of a componentwise unary minus operation on a float2x2 matrix.

    Declaration
    public static float2x2 operator -(float2x2 val)
    Parameters
    Type Name Description
    float2x2 val
    Returns
    Type Description
    float2x2

    UnaryPlus(float2x2)

    Returns the result of a componentwise unary plus operation on a float2x2 matrix.

    Declaration
    public static float2x2 operator +(float2x2 val)
    Parameters
    Type Name Description
    float2x2 val
    Returns
    Type Description
    float2x2
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023