/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat2(cvec2 c0, cvec2 c1) { this.m00 = c0.x; this.m01 = c0.y; this.m10 = c1.x; this.m11 = c1.y; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat3x2(cvec2 c0, cvec2 c1) { this.m00 = c0.x; this.m01 = c0.y; this.m10 = c1.x; this.m11 = c1.y; this.m20 = Complex.Zero; this.m21 = Complex.Zero; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat3x2(cvec2 c0, cvec2 c1, cvec2 c2) { this.m00 = c0.x; this.m01 = c0.y; this.m10 = c1.x; this.m11 = c1.y; this.m20 = c2.x; this.m21 = c2.y; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat2x3(cvec2 c0, cvec2 c1) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = Complex.Zero; this.m10 = c1.x; this.m11 = c1.y; this.m12 = Complex.Zero; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat4x2(cvec2 c0, cvec2 c1, cvec2 c2) { this.m00 = c0.x; this.m01 = c0.y; this.m10 = c1.x; this.m11 = c1.y; this.m20 = c2.x; this.m21 = c2.y; this.m30 = Complex.Zero; this.m31 = Complex.Zero; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat4x2(cvec2 c0, cvec2 c1, cvec2 c2, cvec2 c3) { this.m00 = c0.x; this.m01 = c0.y; this.m10 = c1.x; this.m11 = c1.y; this.m20 = c2.x; this.m21 = c2.y; this.m30 = c3.x; this.m31 = c3.y; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat3(cvec2 c0, cvec2 c1, cvec2 c2) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = Complex.Zero; this.m10 = c1.x; this.m11 = c1.y; this.m12 = Complex.Zero; this.m20 = c2.x; this.m21 = c2.y; this.m22 = Complex.One; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat3x4(cvec2 c0, cvec2 c1) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = Complex.Zero; this.m03 = Complex.Zero; this.m10 = c1.x; this.m11 = c1.y; this.m12 = Complex.Zero; this.m13 = Complex.Zero; this.m20 = Complex.Zero; this.m21 = Complex.Zero; this.m22 = Complex.One; this.m23 = Complex.Zero; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat4x3(cvec2 c0, cvec2 c1, cvec2 c2, cvec2 c3) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = Complex.Zero; this.m10 = c1.x; this.m11 = c1.y; this.m12 = Complex.Zero; this.m20 = c2.x; this.m21 = c2.y; this.m22 = Complex.One; this.m30 = c3.x; this.m31 = c3.y; this.m32 = Complex.Zero; }
/// <summary> /// Constructs this matrix from a series of column vectors. Non-overwritten fields are from an Identity matrix. /// </summary> public cmat4(cvec2 c0, cvec2 c1, cvec2 c2) { this.m00 = c0.x; this.m01 = c0.y; this.m02 = Complex.Zero; this.m03 = Complex.Zero; this.m10 = c1.x; this.m11 = c1.y; this.m12 = Complex.Zero; this.m13 = Complex.Zero; this.m20 = c2.x; this.m21 = c2.y; this.m22 = Complex.One; this.m23 = Complex.Zero; this.m30 = Complex.Zero; this.m31 = Complex.Zero; this.m32 = Complex.Zero; this.m33 = Complex.One; }
/// <summary> /// Returns a hash code for this instance. /// </summary> public static int GetHashCode(cvec2 v) => v.GetHashCode();
/// <summary> /// Returns true iff this equals rhs type- and component-wise. /// </summary> public static bool Equals(cvec2 v, object obj) => v.Equals(obj);
/// <summary> /// Returns true iff this equals rhs component-wise. /// </summary> public static bool Equals(cvec2 v, cvec2 rhs) => v.Equals(rhs);
/// <summary> /// Returns the number of components (2). /// </summary> public static int Count(cvec2 v) => v.Count;
/// <summary> /// Returns a string representation of this vector using a provided seperator and a format and format provider for each component. /// </summary> public static string ToString(cvec2 v, string sep, string format, IFormatProvider provider) => v.ToString(sep, format, provider);
/// <summary> /// Returns a string representation of this vector using a provided seperator and a format for each component. /// </summary> public static string ToString(cvec2 v, string sep, string format) => v.ToString(sep, format);
/// <summary> /// Returns a vector containing component-wise imaginary parts. /// </summary> public static dvec2 Imaginary(cvec2 v) => v.Imaginary;
/// <summary> /// Returns an enumerator that iterates through all components. /// </summary> public static IEnumerator <Complex> GetEnumerator(cvec2 v) => v.GetEnumerator();
/// <summary> /// Returns a bvec2 from component-wise application of NotEqual (lhs != rhs). /// </summary> public static bvec2 NotEqual(cvec2 lhs, cvec2 rhs) => cvec2.NotEqual(lhs, rhs);
/// <summary> /// Calculate the reflection direction for an incident vector (N should be normalized in order to achieve the desired result). /// </summary> public static cvec2 Reflect(cvec2 I, cvec2 N) => cvec2.Reflect(I, N);
/// <summary> /// Returns the squared euclidean distance between the two vectors. /// </summary> public static double DistanceSqr(cvec2 lhs, cvec2 rhs) => cvec2.DistanceSqr(lhs, rhs);
/// <summary> /// Returns the inner product (dot product, scalar product) of the two vectors. /// </summary> public static Complex Dot(cvec2 lhs, cvec2 rhs) => cvec2.Dot(lhs, rhs);
/// <summary> /// Returns a vector containing component-wise real parts. /// </summary> public static dvec2 Real(cvec2 v) => v.Real;
/// <summary> /// Returns true iff distance between lhs and rhs is less than or equal to epsilon /// </summary> public static bool ApproxEqual(cvec2 lhs, cvec2 rhs, double eps = 0.1d) => cvec2.ApproxEqual(lhs, rhs, eps);
/// <summary> /// Returns a bvec2 from component-wise application of Equal (lhs == rhs). /// </summary> public static bvec2 Equal(cvec2 lhs, cvec2 rhs) => cvec2.Equal(lhs, rhs);
/// <summary> /// Returns a vector containing component-wise phases. /// </summary> public static dvec2 Phase(cvec2 v) => v.Phase;
/// <summary> /// Returns a dvec2 from component-wise application of Abs (v.Magnitude). /// </summary> public static dvec2 Abs(cvec2 v) => cvec2.Abs(v);
/// <summary> /// Returns a string representation of this vector using ', ' as a seperator. /// </summary> public static string ToString(cvec2 v) => v.ToString();
/// <summary> /// Returns the length of the outer product (cross product, vector product) of the two vectors. /// </summary> public static Complex Cross(cvec2 l, cvec2 r) => cvec2.Cross(l, r);
/// <summary> /// Returns a string representation of this vector using a provided seperator. /// </summary> public static string ToString(cvec2 v, string sep) => v.ToString(sep);