/// <summary> /// Projection onto the Vector. /// </summary> /// <param name="Vector">Vector to project on.</param> /// <param name="Interval">Ouput. Projection.</param> public override void Project(C2DVector Vector, CInterval Interval) { this.TopLeft.Project(Vector, Interval); Interval.ExpandToInclude(BottomRight.Project(Vector)); C2DPoint TR = new C2DPoint(BottomRight.x, TopLeft.y); C2DPoint BL = new C2DPoint(TopLeft.x, BottomRight.y); Interval.ExpandToInclude(TR.Project(Vector)); Interval.ExpandToInclude(BL.Project(Vector)); }
/// <summary> /// Projection onto the line /// </summary> /// <param name="Line">Line to project on.</param> /// <param name="Interval">Ouput. Projection.</param> public override void Project(C2DLine Line, CInterval Interval) { this.TopLeft.Project(Line, Interval); Interval.ExpandToInclude(BottomRight.Project(Line)); var TR = new C2DPoint(BottomRight.x, TopLeft.y); var BL = new C2DPoint(TopLeft.x, BottomRight.y); Interval.ExpandToInclude(TR.Project(Line)); Interval.ExpandToInclude(BL.Project(Line)); }