当前位置: 首页>>代码示例>>C#>>正文


C# Mathematical.Vector2D类代码示例

本文整理汇总了C#中NGenerics.DataStructures.Mathematical.Vector2D的典型用法代码示例。如果您正苦于以下问题:C# Vector2D类的具体用法?C# Vector2D怎么用?C# Vector2D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Vector2D类属于NGenerics.DataStructures.Mathematical命名空间,在下文中一共展示了Vector2D类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Simple

 public void Simple()
 {
     var vector = new Vector2D(4, 7);
     vector.Increment();
     Assert.AreEqual(5, vector.X);
     Assert.AreEqual(8, vector.Y);
 }
开发者ID:havok,项目名称:ngenerics,代码行数:7,代码来源:Increment.cs

示例2: OperatorDivideDoubleExample

 public void OperatorDivideDoubleExample()
 {
     var vector2D = new Vector2D(4, 12);
     var vector = vector2D/2;
     Assert.AreEqual(2, vector.X);
     Assert.AreEqual(6, vector.Y);
 }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:7,代码来源:Vector2DExamples.Operators.cs

示例3: Simple

 public void Simple()
 {
     var vector = new Vector2D { X = 1, Y = 2 };
     Assert.AreNotEqual(0, vector.GetHashCode());
     Assert.AreEqual(1, vector.X);
     Assert.AreEqual(2, vector.Y);
 }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:7,代码来源:GetHashCodeObj.cs

示例4: ExceptionLeftNull

        public void ExceptionLeftNull()
        {
            const Vector2D vector1 = null;
            var vector2 = new Vector2D(2, 2);

            var condition = vector1 <= vector2;
        }
开发者ID:havok,项目名称:ngenerics,代码行数:7,代码来源:LessThanEqualToOperator.cs

示例5: Simple

 public void Simple()
 {
     var vector = new Vector2D { X = 1, Y = 2 };
     vector.SetValues(4, 6);
     Assert.AreEqual(4, vector.X);
     Assert.AreEqual(6, vector.Y);
 }
开发者ID:havok,项目名称:ngenerics,代码行数:7,代码来源:SetValues.cs

示例6: ExceptionRightNull

        public void ExceptionRightNull()
        {
            var vector1 = new Vector2D(2, 2);
            const Vector2D vector2 = null;

            var condition = vector1 >= vector2;
        }
开发者ID:havok,项目名称:ngenerics,代码行数:7,代码来源:GreaterThanEqualToOperator.cs

示例7: Simple

 public void Simple()
 {
     var vector2D = new Vector2D();
     Assert.AreEqual(2, vector2D.DimensionCount);
     Assert.AreEqual(0, vector2D.X);
     Assert.AreEqual(0, vector2D.Y);
 }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:7,代码来源:Contruction.cs

示例8: OperatorDivideVectorExample

 public void OperatorDivideVectorExample()
 {
     var vector2D1 = new Vector2D(4, 8);
     var vector2D2 = new Vector2D(2, 2);
     var vector = vector2D1/vector2D2;
     Assert.AreEqual(1, vector.X);
     Assert.AreEqual(2, vector.Y);
 }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:8,代码来源:Vector2DExamples.Operators.cs

示例9: AbsoluteMaximumExample

        public void AbsoluteMaximumExample()
        {
            var vector1 = new Vector2D(1, -4);
            Assert.AreEqual(4, vector1.AbsoluteMaximum());

            var vector2 = new Vector2D(5, -4);
             Assert.AreEqual(5, vector2.AbsoluteMaximum());
        }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:8,代码来源:Vector2DExamples.cs

示例10: Simple

        public void Simple()
        {
            var vector = new Vector2D(23, 21);

            vector.Normalize();

            Assert.AreEqual(1, vector.Magnitude());
        }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:8,代码来源:Normalize.cs

示例11: Simple

        public void Simple()
        {
            var vector = new Vector2D(1, -4);

            Assert.AreEqual(-4, vector.Minimum());
            Assert.AreEqual(1, vector.X);
            Assert.AreEqual(-4, vector.Y);
        }
开发者ID:havok,项目名称:ngenerics,代码行数:8,代码来源:Minimum.cs

示例12: AbsoluteMinimumIndexExample

        public void AbsoluteMinimumIndexExample()
        {
            var vector1 = new Vector2D(1, -4);
            Assert.AreEqual(0, vector1.AbsoluteMinimumIndex());

            var vector2 = new Vector2D(-4, 1);
            Assert.AreEqual(1, vector2.AbsoluteMinimumIndex());
        }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:8,代码来源:Vector2DExamples.cs

示例13: Simple

        public void Simple()
        {
            var vector2D = new Vector2D(4, 7);

            vector2D--;

            Assert.AreEqual(3, vector2D.X);
            Assert.AreEqual(6, vector2D.Y);
        }
开发者ID:havok,项目名称:ngenerics,代码行数:9,代码来源:DecrementOperator.cs

示例14: AddDoubleExample

        public void AddDoubleExample()
        {
            var vector = new Vector2D(4, 7);

            vector.Add(1);

            Assert.AreEqual(5, vector.X);
            Assert.AreEqual(8, vector.Y);
        }
开发者ID:GTuritto,项目名称:ngenerics,代码行数:9,代码来源:Vector2DExamples.cs

示例15: Simple

        public void Simple()
        {
            var vector = new Vector2D(2, 3);

            Assert.AreEqual(5, vector.Sum());

            Assert.AreEqual(2, vector.X);
            Assert.AreEqual(3, vector.Y);
        }
开发者ID:havok,项目名称:ngenerics,代码行数:9,代码来源:Sum.cs


注:本文中的NGenerics.DataStructures.Mathematical.Vector2D类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。