Hello, Danielle!
Is this a homework problem . . with latitude/longitude coordinates?
It's pretty messy . . .
I need to know the formula for finding the distance between 2 parallel lines.
More specifically, it's 2 parallel runways on the airport surface.
How exactly should I go about calculating this?
I have access to the lat/long coordinates,
so I am able to find the length of the runways and distance between ends.
I won't make any assumptions about the two runways
. . . like: they are the same length or they are anywhere near each other.
Code:
B
*(x2,y2)
*
A * Runway 1 goes from A to B.
*
(x1,y1) D Runway 2 goes from C to D.
*
*
*
*
C *
*
(p,q)
I assume you can convert lat/long to cartesian coordinates.
There is a formula for this . . .
The distance from a point C(p,q) to a line:
.ax + by + c
.=
.0
. . . . . . . . . . . . . . . . . . . |ap + bq + c|
. . . is given by:
. d
. =
. ----<u>----------</u>---
. . . . . . . . . . . . . . . . . . . . .√a<sup>2</sup> + b<sup>2</sup>
Find the equation for Runway 1 . . . It is the line through points A and B.
. . . (y<sub>2</sub> - y<sub>1</sub>)x - (x<sub>2</sub> - x<sub>1</sub>)y + [(y<sub>1</sub>(x<sub>2</sub> - x<sub>1</sub>) - x<sub>1</sub>(y<sub>2</sub> - y<sub>1</sub>)]
. =
. 0
Use any point on Runway 2, say, C(p,q)
And run them through the above formula . . .
Good luck!