Esempio n. 1
0
        public IEnumerable <Point> ToSegments(double segmentLength)
        {
            var vector    = (Vector)_center;
            var transform = GraphicHelper.CreateRotateMatrix(_center, _rotateAngle);
            var points    = GraphicHelper.ToSegments(_lr, _sr, 0, Math.PI * 2, segmentLength);

            if (_isReverse)
            {
                points.Reverse();
            }
            return(points.Select(p => (p + vector) * transform));
        }
Esempio n. 2
0
        public Point GetPoint(double length, double segmentLength)
        {
            if (length < 0 || length > Length)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (_isReverse)
            {
                length = Length - length;
            }
            var parameter = GraphicHelper.GetParameter(_lr, _sr, 0, length, segmentLength);

            return(_center + new Vector(_lr * Math.Cos(parameter), _sr * Math.Sin(parameter)) * GraphicHelper.CreateRotateMatrix(_center, _rotateAngle));
        }