public override bool Equals(object obj) { if (obj == null || !(obj is Vector2Double)) { return(false); } Vector2Double v3 = (Vector2Double)obj; return(v3.x == x && v3.y == y); }
public static Vector2Double TwoVertexNormalExpensive(Vector2Double first, Vector2Double second) { var sum = first.normalized + second.normalized; if (sum != zero) { return((sum.normalized * Mathf.Sign((float)((first.y * second.x) - (first.x * second.y)))).normalized); } else { return(new Vector2Double(first.y, -first.x)); } }
public static Vector2Double Normalize(Vector2Double input) { double length = input.Length; return(new Vector2Double(input.x / length, input.y / length)); }
public static Vector2Double Round(Vector2Double vector2, int dec) { return(new Vector2Double(Math.Round(vector2.x, dec), Math.Round(vector2.y, dec))); }
public static Vector2Double TwoVertexNormal(Vector2Double first, Vector2Double second) { return((first.normalized + second.normalized).normalized * Mathf.Sign((float)((first.y * second.x) - (first.x * second.y)))); }