meena moon

meena moon

  • NA
  • 39
  • 8.7k

point in c#

Feb 11 2016 4:12 PM
I have this code ,I want to send pt1 and pt2 when click on button to method I have problem in prototype of pt1 and pt2 what is the change I should to do ?
 
public double angleOf(Point p1, Point p2)
{
double deltaY = (p2.Y - p1.Y);
double deltaX = (p2.X - p1.X);
double result = Math.Atan2(deltaY, deltaX);
result *= (180 / Math.PI);
result += 22.5;
return (result < 0) ? (360d + result) : result;
}
private void button1_Click(object sender, EventArgs e)
{
double angle;
Point pt1 = 4428900.38515348;
Point pt2 = 4428900.38515346;
angle = angleOf(pt1, pt2);
textBox1.Text += angle;
 

Answers (9)