첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.

728x90
반응형
728x170
using System;
using System.Windows;

#region 회전하기 - Rotate(sourcePoint, angle, centerX, centerY)

/// <summary>
/// 회전하기
/// </summary>
/// <param name="sourcePoint">소스 포인트</param>
/// <param name="angle">각도</param>
/// <param name="centerX">중심 X</param>
/// <param name="centerY">중심 Y</param>
/// <returns>회전 포인트</returns>
public Point Rotate(Point sourcePoint, double angle, double centerX, double centerY)
{
    double radian = angle * (Math.PI / 180d);

    double targetX = Math.Cos(radian) * (sourcePoint.X - centerX) - Math.Sin(radian) * (sourcePoint.Y - centerY) + centerX;
    double targetY = Math.Sin(radian) * (sourcePoint.X - centerX) + Math.Cos(radian) * (sourcePoint.Y - centerY) + centerY;

    return new Point(targetX, targetY);
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요