public Vector4H(Vector2H v, Half z, Half w) { _x = v.X; _y = v.Y; _z = z; _w = w; }
public void TestEquals() { Vector2H a = new Vector2H(1.0f, 2.0f); Vector2H b = new Vector2H(4.0f, 5.0f); Vector2H c = new Vector2H(1.0f, 2.0f); Assert.IsTrue(a.Equals(c)); Assert.IsTrue(c.Equals(a)); Assert.IsTrue(a == c); Assert.IsTrue(c == a); Assert.IsFalse(c != a); Assert.IsFalse(c != a); Assert.IsFalse(a.Equals(b)); Assert.IsFalse(b.Equals(a)); Assert.IsFalse(a == b); Assert.IsFalse(b == a); Assert.IsTrue(a != b); Assert.IsTrue(b != a); object objA = a; object objB = b; object objC = c; Assert.IsTrue(a.Equals(objA)); Assert.IsTrue(a.Equals(objC)); Assert.IsFalse(a.Equals(objB)); Assert.IsTrue(objA.Equals(objC)); Assert.IsFalse(objA.Equals(objB)); Assert.IsFalse(a.Equals(null)); Assert.IsFalse(a.Equals(5)); }
public void ToVector2H() { Vector2F a = new Vector2F(1.0f, 2.0f); Vector2H sA = a.ToVector2H(); Assert.AreEqual((Half)1.0, sA.X, 1e-7); Assert.AreEqual((Half)2.0, sA.Y, 1e-7); }
public void XY() { Vector4H a = new Vector4H(1.0, 2.0, 3.0, 4.0); Vector2H xy = a.XY; Assert.AreEqual((Half)1.0, xy.X); Assert.AreEqual((Half)2.0, xy.Y); }
public void ToVector2H() { Vector2I a = new Vector2I(1, 2); Vector2H sA = a.ToVector2H(); Assert.AreEqual((Half)1, sA.X, 1e-7); Assert.AreEqual((Half)2, sA.Y, 1e-7); }
public void ToVector2H() { Vector2B a = new Vector2B(false, true); Vector2H sA = a.ToVector2H(); Assert.AreEqual((Half)0.0, sA.X, 1e-7); Assert.AreEqual((Half)1.0, sA.Y, 1e-7); }
public void ToVector2B() { Vector2H a = new Vector2H(1.0, 0.0); Vector2B sA = a.ToVector2B(); Assert.IsTrue(sA.X); Assert.IsFalse(sA.Y); }
public void ToVector2I() { Vector2H a = new Vector2H(1.0, 2.0); Vector2I sA = a.ToVector2I(); Assert.AreEqual(1, sA.X); Assert.AreEqual(2, sA.Y); }
public void ToVector2D() { Vector2H a = new Vector2H(1.0, 2.0); Vector2D sA = a.ToVector2D(); Assert.AreEqual(1.0, sA.X, 1e-7); Assert.AreEqual(2.0, sA.Y, 1e-7); }
public void TestGetHashCode() { Vector2H a = new Vector2H(1.0f, 2.0f); Vector2H b = new Vector2H(4.0f, 5.0f); Vector2H c = new Vector2H(1.0f, 2.0f); Assert.AreEqual(a.GetHashCode(), c.GetHashCode()); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Construct() { Vector2H v1 = new Vector2H(1.0f, 2.0f); Assert.AreEqual((Half)1.0f, v1.X); Assert.AreEqual((Half)2.0f, v1.Y); Vector2H v2 = new Vector2H(1.0, 2.0); Assert.AreEqual((Half)1.0, v2.X); Assert.AreEqual((Half)2.0, v2.Y); }
public void TestToString() { CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture; try { Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); Vector2H a = new Vector2H(1.23f, 2.34f); Assert.AreEqual("(1,230469, 2,339844)", a.ToString()); } finally { Thread.CurrentThread.CurrentCulture = originalCulture; } }
public Vector3H(Vector2H v, Half z) { _x = v.X; _y = v.Y; _z = z; }
public RectangleH(Vector2H lowerLeft, Vector2H upperRight) { _lowerLeft = lowerLeft; _upperRight = upperRight; }