첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System;
using System.Windows;

#region 회전하기 - Rotate(sourcePoint, centerPoint, rotateAngle)

/// <summary>
/// 회전하기
/// </summary>
/// <param name="sourcePoint">소스 포인트</param>
/// <param name="centerPoint">중심 포인트</param>
/// <param name="rotateAngle">회전 각도</param>
/// <returns>회전 포인트</returns>
public Point Rotate(Point sourcePoint, Point centerPoint, double rotateAngle)
{
    Point targetPoint = new Point();

    double radian = rotateAngle / 180 * Math.PI;

    targetPoint.X = Math.Cos(radian) * (sourcePoint.X - centerPoint.X) -
                    Math.Sin(radian) * (sourcePoint.Y - centerPoint.Y) + centerPoint.X;
    targetPoint.Y = Math.Sin(radian) * (sourcePoint.X - centerPoint.X) +
                    Math.Cos(radian) * (sourcePoint.Y - centerPoint.Y) + centerPoint.Y; 

    return targetPoint;
}

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

댓글을 달아 주세요