using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Azimuth; namespace Annulus.UnitTests { public class TriangleTests : UnitTestSharp.TestFixture { public class ProjectionToAxis : UnitTestSharp.TestFixture { public void ProjectToXAxis() { Interval projection = Triangle.ProjectionToAxis( new Vector(0, 0), new Vector(1, 0), new Vector(0.5, 2), Vector.UnitX); CheckEqual(new Interval(0, 1), projection); } public void ProjectToYAxis() { Interval projection = Triangle.ProjectionToAxis( new Vector(0, 0), new Vector(1, 0), new Vector(0.5, 2), Vector.UnitY); CheckEqual(new Interval(0, 2), projection); } public void ProjectToZeroLengthAxis() { Interval projection = Triangle.ProjectionToAxis( new Vector(0, 0), new Vector(1, 0), new Vector(0.5, 2), Vector.Zero); CheckEqual(new Interval(0, 0), projection); } public void ProjectToUnnormalizedAxis() { Interval projection = Triangle.ProjectionToAxis( new Vector(0, 0), new Vector(1, 0), new Vector(0.5, 2), -2 * Vector.UnitX); CheckEqual(new Interval(-2, 0), projection); } } } }