Esempio n. 1
0
        public void TestMassProperties()
        {
            Triangle2 testTriangle =
                new Triangle2(
                    new Vector2(100.0f, 100.0f), new Vector2(110.0f, 100.0f), new Vector2(105.0f, 110.0f)
                    );

            Assert.AreEqual(
                new Vector2(105.0f, 103.33333333333333f), testTriangle.CenterOfMass,
                "Center of mass is correctly positioned"
                );

            Assert.AreEqual(50.0f, testTriangle.Area, "Mass of triangle is exactly determined");
            Assert.AreEqual(
                18.708286933869708f, testTriangle.CircumferenceLength,
                "Surface area of triangle is exactly determined"
                );
        }
Esempio n. 2
0
    public void TestMassProperties() {
      Triangle2 testTriangle =
        new Triangle2(
          new Vector2(100.0f, 100.0f), new Vector2(110.0f, 100.0f), new Vector2(105.0f, 110.0f)
        );

      Assert.AreEqual(
        new Vector2(105.0f, 103.33333333333333f), testTriangle.CenterOfMass,
        "Center of mass is correctly positioned"
      );

      Assert.AreEqual(50.0f, testTriangle.Area, "Mass of triangle is exactly determined");
      Assert.AreEqual(
        18.708286933869708f, testTriangle.CircumferenceLength,
        "Surface area of triangle is exactly determined"
      );

    }