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; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)