Пример #1
0
        /// <summary>
        /// Projection onto the vector as distance along the line from the start of the vector.
        /// Result is stored as an CInterval Min and Max,
        /// </summary>
        /// <param name="Vector">Vector to project this onto.</param>
        /// <param name="Interval">Interval to recieve the result.</param>
        public override void Project(C2DVector Vector, CInterval Interval)
        {
            // Create a line that goes through the circle from edge to edge and with the same vector.
            C2DLine Line = new C2DLine(_Centre, Vector);

            Line.vector.SetLength(Radius * 2);

            C2DVector V2 = new C2DVector(Vector);

            V2.Multiply(-0.5);
            Line.Move(V2);

            // Now just project the line onto the interval.
            Line.Project(Vector, Interval);
        }
Пример #2
0
        /// <summary>
        /// Projection onto the line as distance along the line from the start of the line.
        /// Result is stored as an CInterval Min and Max,
        /// </summary>
        /// <param name="Line">Line to project this onto.</param>
        /// <param name="Interval">Interval to recieve the result.</param>
        public override void Project(C2DLine Line, CInterval Interval)
        {
            // Create a line that goes through the circle from edge to edge and with the same vector as the
            // Line to project on.
            var LineCopy = new C2DLine(_Centre, Line.vector);

            LineCopy.vector.SetLength(Radius * 2);

            var V2 = new C2DVector(LineCopy.vector);

            V2.Multiply(-0.5);

            LineCopy.Move(V2);

            // Now just project the line onto the interval.
            LineCopy.Project(Line, Interval);
        }
Пример #3
0
        /// <summary>
        /// Projection onto the vector as distance along the line from the start of the vector.
        /// Result is stored as an CInterval Min and Max,
        /// </summary>
        /// <param name="Vector">Vector to project this onto.</param> 
        /// <param name="Interval">Interval to recieve the result.</param> 
        public override void Project(C2DVector Vector,  CInterval Interval)
        {
            // Create a line that goes through the circle from edge to edge and with the same vector.
            C2DLine Line = new C2DLine (_Centre, Vector);

            Line.vector.SetLength( Radius * 2 );

            C2DVector V2 = new C2DVector(Vector);
            V2.Multiply(-0.5);
            Line.Move(V2);

            // Now just project the line onto the interval.
            Line.Project(Vector,  Interval);
        }