# Find the Length Between 2 Points With X, Y of Both Points and Angle of Line?

• Aug 31st 2009, 06:07 PM
jebego
Find the Length Between 2 Points With X, Y of Both Points and Angle of Line?
need to have a math equation that finds the length of the segment of line that is located between 2 points on that line.
The variables I know are:

1. x, y of one point
2. x, y of other point
3. angle of the line (it can rotate anywhere in 360 degrees, its rotation point is the second point)

I'm just a programmer who isn't that good at math :)

And here's the pic of the math problem for some visual:
EDIT: Oops, never mind about the Radius of the circle, that wont help.
• Aug 31st 2009, 10:00 PM
earboth
Quote:

Originally Posted by jebego
need to have a math equation that finds the length of the segment of line that is located between 2 points on that line.
The variables I know are:

1. x, y of one point
2. x, y of other point
3. angle of the line (it can rotate anywhere in 360 degrees, its rotation point is the second point)

I'm just a programmer who isn't that good at math :)

And here's the pic of the math problem for some visual:
EDIT: Oops, never mind about the Radius of the circle, that wont help.

I'm not sure that I understand your question correctly ...

In general: If you have 2 points $\displaystyle P_1(x_1, y_1)$ and $\displaystyle P_2(x_2, y_2)$ then the distance between these 2 points is calculated by:

$\displaystyle d = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}$

In 3-D-space you have:

If you have 2 points $\displaystyle P_1(x_1, y_1, z_1)$ and $\displaystyle P_2(x_2, y_2, z_2)$ then the distance between these 2 points is calculated by:

$\displaystyle d = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2 + (z_1 - z_2)^2}$
• Sep 4th 2009, 10:19 PM
usmelikchees
In your case jepego x1 and y1 would = 0

x2 and y2 are the points of the other x and y. The equation above will give you the distance.