Пример #1
0
 public void ToVector()
 {
     DoublePointTest.AssertPointEquals(new DoublePoint(1, 0), DoubleAngle.ToVector(-DoubleAngle.Pi2), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(0, 1), DoubleAngle.ToVector(-1.5 * Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(-1, 0), DoubleAngle.ToVector(-Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(0, -1), DoubleAngle.ToVector(-0.5 * Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(1, 0), DoubleAngle.ToVector(0), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(Math.Sqrt(2) / 2, Math.Sqrt(2) / 2), DoubleAngle.ToVector(Math.PI / 4), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(0, 1), DoubleAngle.ToVector(Math.PI / 2), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(-1, 0), DoubleAngle.ToVector(Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(0, -1), DoubleAngle.ToVector(1.5 * Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(1, 0), DoubleAngle.ToVector(DoubleAngle.Pi2), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(0, 1), DoubleAngle.ToVector(2.5 * Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(-1, 0), DoubleAngle.ToVector(3 * Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(0, -1), DoubleAngle.ToVector(3.5 * Math.PI), 0.01);
     DoublePointTest.AssertPointEquals(new DoublePoint(1, 0), DoubleAngle.ToVector(2 * DoubleAngle.Pi2), 0.01);
 }
Пример #2
0
 public void AddAt()
 {
     M.Add(new IntPoint(2, 4), new DoublePoint(100, 200));
     DoublePointTest.AssertPointEquals(new DoublePoint(120, 240), M[2, 4], 0.001);
 }
Пример #3
0
 public void AddValues()
 {
     M.Add(3, 1, 100, 200);
     DoublePointTest.AssertPointEquals(new DoublePoint(130, 210), M[3, 1], 0.001);
 }
Пример #4
0
 public void Add()
 {
     M.Add(2, 3, new DoublePoint(100, 200));
     DoublePointTest.AssertPointEquals(new DoublePoint(120, 230), M[2, 3], 0.001);
 }
Пример #5
0
 public void SetAt()
 {
     M[new IntPoint(3, 2)] = new DoublePoint(101, 102);
     DoublePointTest.AssertPointEquals(new DoublePoint(101, 102), M[3, 2], 0.001);
 }
Пример #6
0
 public void Set()
 {
     M[1, 2] = new DoublePoint(101, 102);
     DoublePointTest.AssertPointEquals(new DoublePoint(101, 102), M[1, 2], 0.001);
 }
Пример #7
0
 public void SetValues()
 {
     M.Set(2, 4, 101, 102);
     DoublePointTest.AssertPointEquals(new DoublePoint(101, 102), M[2, 4], 0.001);
 }
Пример #8
0
 public void GetAt()
 {
     DoublePointTest.AssertPointEquals(new DoublePoint(10, 20), M[new IntPoint(1, 2)], 0.001);
     DoublePointTest.AssertPointEquals(new DoublePoint(20, 40), M[new IntPoint(2, 4)], 0.001);
 }
Пример #9
0
 public void Get()
 {
     DoublePointTest.AssertPointEquals(new DoublePoint(20, 30), M[2, 3], 0.001);
     DoublePointTest.AssertPointEquals(new DoublePoint(30, 10), M[3, 1], 0.001);
 }