public void GetLengthTest() { Vector2D v1 = new Vector2D(100, 200); var length = v1.GetLength(); Assert.AreEqual(223.6068, Math.Round(length * 10000) / 10000); }
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)); }