private Point GetArcSpecialPoint(CornerPos cornerPos, double availableAngle, Corner corner) { var d1 = Math.Sin(availableAngle * Math.PI / 180) * corner.Radius; var d2 = (1 - Math.Cos(availableAngle * Math.PI / 180)) * corner.Radius; Point result = new Point(); switch (cornerPos) { case CornerPos.TopLeft: result = new Point(corner.ArcFromPoint.X + d2, corner.ArcFromPoint.Y - d1); break; case CornerPos.TopRight: result = new Point(corner.ArcFromPoint.X + d1, corner.ArcFromPoint.Y + d2); break; case CornerPos.BottomRight: result = new Point(corner.ArcFromPoint.X - d2, corner.ArcFromPoint.Y + d1); break; case CornerPos.BottomLeft: result = new Point(corner.ArcFromPoint.X - d1, corner.ArcFromPoint.Y - d2); break; } return(result); }
public CornerInfo(CornerPos cornerPos, double radius, double circleThickness, double width, double height) : this() { _cornerPos = cornerPos; _radius = radius; _circleThickness = circleThickness; _width = width; _height = height; IsRightAngle = DoubleUtil.IsZero(_radius); OuterCorner = ConstructCorner(0, circleThickness); InnerCorner = ConstructCorner(circleThickness); }