Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
            }
        }
Ejemplo n.º 3
0
        public static Vector2Double Normalize(Vector2Double input)
        {
            double length = input.Length;

            return(new Vector2Double(input.x / length, input.y / length));
        }
Ejemplo n.º 4
0
 public static Vector2Double Round(Vector2Double vector2, int dec)
 {
     return(new Vector2Double(Math.Round(vector2.x, dec), Math.Round(vector2.y, dec)));
 }
Ejemplo n.º 5
0
 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))));
 }