/// <summary> /// Set the ith column from avector. /// </summary> public void SetColumn(int iCol, Vector2f v) { this[0, iCol] = v.x; this[1, iCol] = v.y; }
/// <summary> /// Set the ith row from avector. /// </summary> public void SetRow(int iRow, Vector2f v) { this[iRow, 0] = v.x; this[iRow, 1] = v.y; }
/// <summary> /// The maximum value between each component in vectors. /// </summary> public void Max(Vector2f v) { x = Math.Max(x, v.x); y = Math.Max(y, v.y); }
/// <summary> /// Clamp the each component to specified min and max. /// </summary> public void Clamp(Vector2f min, Vector2f max) { x = Math.Max(Math.Min(x, max.x), min.x); y = Math.Max(Math.Min(y, max.y), min.y); }
/// <summary> /// The minimum value between each component in vectors. /// </summary> public void Min(Vector2f v) { x = Math.Min(x, v.x); y = Math.Min(y, v.y); }
/// <summary> /// Distance between two vectors. /// </summary> public static float Distance(Vector2f v0, Vector2f v1) { return(FMath.SafeSqrt(SqrDistance(v0, v1))); }
/// <summary> /// Cross two vectors. /// </summary> public static float Cross(Vector2f v0, Vector2f v1) { return(v0.x * v1.y - v0.y * v1.x); }
/// <summary> /// The dot product of two vectors. /// </summary> public static float Dot(Vector2f v0, Vector2f v1) { return(v0.x * v1.x + v0.y * v1.y); }
/// <summary> /// Are these vectors equal. /// </summary> public bool Equals(Vector2f v) { return(this == v); }