Ejemplo n.º 1
0
        public void GetLengthTest()
        {
            Vector2D v1 = new Vector2D(100, 200);

            var length = v1.GetLength();

            Assert.AreEqual(223.6068, Math.Round(length * 10000) / 10000);
        }
Ejemplo n.º 2
0
 public Vector2D SetAngle(Vector2D v, float number)
 {
     var lenght = v.GetLength();
     return new Vector2D(Convert.ToSingle(Math.Cos(number) * lenght),
                         Convert.ToSingle(Math.Sin(number) * lenght));
 }