m3
This commit is contained in:
27
tests/AffineSpaceTest.cs
Normal file
27
tests/AffineSpaceTest.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Numerics;
|
||||
using Skeleton.Algebra.AffineSpaces;
|
||||
using Skeleton.Algebra.DimensionProviders;
|
||||
|
||||
namespace SkeletonTest.tests;
|
||||
|
||||
|
||||
using AffineC2Space = Skeleton.Algebra.CategoryOf<IDim2>.OnField<Complex>.FAffineSpace;
|
||||
public static class AffineSpaceTest
|
||||
{
|
||||
[Test]
|
||||
public static void BasicAffineSpaceTest()
|
||||
{
|
||||
AffineC2Space ac2s =
|
||||
AffineSpace<C2, C22, C2Space, AffineC2Space>.Dispatch(
|
||||
new C2[] { new(1, 0) },
|
||||
new C2(1, 1)
|
||||
);
|
||||
Assert.IsTrue(ac2s.ContainsPoint(new C2(new Complex[]{2, 1} )));
|
||||
Assert.IsTrue(ac2s.ContainsPoint(new C2(new Complex[]{-7, 1})));
|
||||
Assert.IsTrue(ac2s.ContainsPoint(new C2(new Complex[]{0, 1})));
|
||||
Assert.IsFalse(ac2s.ContainsPoint(new C2(new Complex[]{1, 0})));
|
||||
Assert.IsFalse(ac2s.ContainsPoint(new C2(new Complex[]{0, 0})));
|
||||
Assert.That(ac2s.Dim, Is.EqualTo(2));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user