[color=Blue]Dim[/color] horizontalDistance [color=Blue]As Integer[/color] = Point2.X - Point1.X
[color=Blue] Dim[/color] verticalDistance [color=Blue]As Integer[/color] = Point2.Y - Point1.Y
[color=Green] 'Calculate the horizontal angle in radians.[/color]
[color=Blue] Dim[/color] horizontalAngleRads [color=Blue]As Double[/color] = Math.Atan(verticalDistance / horizontalDistance)
[color=Green]'Calculate the horizontal angle in degrees.[/color]
[color=Blue] Dim[/color] horizontalAngleDegs [color=Blue]As Double[/color] = 180 * horizontalAngleRads / Math.PI
[color=Green] 'Calculate the vertical angle in radians.[/color]
[color=Blue] Dim[/color] verticalAngleRads [color=Blue]As Double[/color] = Math.Atan(horizontalDistance / verticalDistance)
[color=Green] 'Calculate the vertical angle in degrees.[/color]
[color=Blue] Dim[/color] verticalAngleDegs [color=Blue]As Double[/color] = 180 * verticalAngleRads / Math.PI