PointF, Convert.ToString, method
public double Angle(PointF Pt1, PointF Pt2) //**********
{
double result;
// 각도 계산
result = Math.Atan((Pt2.Y - Pt1.Y) / (Pt2.X - Pt1.X));
return result;
}
//**************
private void button1_Click(object sender, System.EventArgs e)
{
PointF P1 = new PointF(-2.3f,3.1f);
PointF P2 = new PointF(0.3f,-1.7f);
double aa, bb;
aa = Angle(P1, P2);
bb = aa / Units.P_Angle.Phi * 180.0f;
MessageBox.Show(Convert.ToString(Convert.ToString(bb)));
}
댓글
댓글 쓰기