public Point GetPoint(double length, double segmentLength) { if (length < 0 || length > Length) { throw new ArgumentOutOfRangeException(); } if (_isReverse) { length = Length - length; } var parameter = GraphicHelper.GetParameter(_degree, _controlPoints, _knots, _weights, _startParameter, length, _length, segmentLength); return(GraphicHelper.ComputePoint(_degree, _knots, _controlPoints, _weights, parameter)); }
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)); }
public IEnumerable <IGraphic> Spilt(IEnumerable <Segment> segments, double segmentLength) { foreach (var segment in segments) { var startOffset = segment.StartOffset; var endOffset = segment.EndOffset; if (_isReverse) { startOffset = _length - segment.EndOffset; endOffset = _length - segment.StartOffset; } var startAngle = Utilities.RadianToAngle(GraphicHelper.GetParameter(_lr, _sr, 0, startOffset, segmentLength)); var endAngle = Utilities.RadianToAngle(GraphicHelper.GetParameter(_lr, _sr, 0, endOffset, segmentLength)); yield return(new GraphicEllipticalArc(_center, _lr, _sr, startAngle, endAngle, _rotateAngle, _isReverse)); } }
public Vector GetTangent(double length, double segmentLength) { if (length < 0 || length > Length) { throw new ArgumentOutOfRangeException(); } if (_isReverse) { length = Length - length; } var parameter = GraphicHelper.GetParameter(_degree, _controlPoints, _knots, _weights, _startParameter, length, _length, segmentLength); var dir = GraphicHelper.ComputeVector(_degree, 1, _knots, _controlPoints, parameter); if (_isReverse) { dir = -dir; } return(dir); }
public Vector GetTangent(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); var dir = new Vector(-_lr * Math.Sin(parameter), _sr * Math.Cos(parameter)); if (_isReverse) { dir = -dir; } return(dir); }