【发布时间】:2011-09-09 19:47:41
【问题描述】:
我有两条线是这样画的:
float Alpha = RotDegrees;
PointF PitCenter = new Point(picBoxZoomMap.Width / 2, picBoxZoomMap.Height / 2);
PointF p = new PointF(PitCenter.X - 20, PitCenter.Y - 250);
PointF p2 = new PointF(PitCenter.X + 20, PitCenter.Y - 250);
zoomgfx.DrawLine(Pens.Red, PitCenter, new PointF(
(float)((p.Y - PitCenter.Y) * Math.Sin(Alpha * Math.PI / 180) + p.X),
(float)(PitCenter.Y + (p.Y - PitCenter.Y) * Math.Cos(Alpha * Math.PI / 180))));
zoomgfx.DrawLine(Pens.Red, PitCenter, new PointF(
(float)((p2.Y - PitCenter.Y) * Math.Sin(Alpha * Math.PI / 180) + p2.X),
(float)(PitCenter.Y + (p2.Y - PitCenter.Y) * Math.Cos(Alpha * Math.PI / 180))));
这里是 Alpha = 0 时的行;
这是旋转 90 度后的线条..
正如你所看到的那样,线条以某种方式相遇..我真的不明白为什么.. 有什么想法吗?
【问题讨论】:
标签: c# math rotation trigonometry system.drawing