0

# How do you find the direction from x1y1 to x2y2 in 360 where 0 is right it goes counter clockwise and Y goes down X goes right?

Updated: 12/23/2022

Wiki User

14y ago

tan θ = sin θ / cos θ

tan θ = (y2 - y1) / (x2 - x1)

θ = tan-1((y2 - y1) / (x2 - x1))

To begin with, I will refer to the "where 0 is right it goes counter clockwise" as the 'Polar Clock'. A polar clock has 0* facing the right, 90* facing up, 180* facing left, 270* facing down, and 360* once again facing right.

In order to find the answer, we must build a right triangle using the two points (in this example 1,1 and 3,5) as the corners attached by the longest side (opposite the right angle). To find the lengths of the two shorter sides, take corresponding values of your points and subtract them. In this example, 5-1 = 4, the vertical line (y2 - y1), and 3-1 = 2, the horizontal line (x1 - x2).

Once you know the value of these two sides, a trigonometric function can be used to determine the position on the polar clock of the longest side (between the two points). The function Tangent (tan) is equal to the opposite side of the triangle divided by the adjacent side of the triangle. In this example, where θ is the unknown angle, tan(θ) = 4/3.

In order to solve this in a timely fashion, it is recommended to use a calculator. In order to use a calculator, you must change the notation from [tan(θ) = 4/3] to [θ = tan-1(4/3)]. The easiest way to describe tan-1 is that it is the opposite of tan. To find the angle, simply type [tan-1(4/3)] into any suitable calculator.

As listed in the first example, the formula is as follows:

θ = tan-1((y2 - y1) / (x2 - x1))

Wiki User

14y ago