public void Vector_ProjectOntoPlane() { Vector testSegment = new Vector(Point.MakePointWithInches(2, 5, 3)); Plane projectOnto = new Plane(Line.XAxis, Line.YAxis); Vector result = testSegment.ProjectOntoPlane(projectOnto); Vector expected = new Vector(Point.MakePointWithInches(2, 5)); result.Should().Be(expected); }
public void LineSegment_ProjectOntoPlane_ShouldReturnVectorProjection_IfVectorLengthIsNotZero() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1)); Plane plane = new Plane(Direction.Right); Vector vector = new Vector(lineSegment.BasePoint, lineSegment.EndPoint); lineSegment.ProjectOntoPlane(plane).Should().Be(new LineSegment(vector.ProjectOntoPlane(plane))); }