Well, I thought this would be the easy part of this project. Turns out I was wrong.

I am writing a program that will determine line-of-sight between two prospective points for microwave radio reception.

If I know the coordinates of point "A" and point "B", How can I calculate multiple points between them. Depending upon the terrain, I will need to increase the density of the sampling points.

For example, I know the starting point is at 36.919506, -121.341454. The destination is at 36.919506, -121.341454 .

How can I get the coordinates for points every 200 ft along this path? 500 ft.?

I am writing a program that will determine line-of-sight between two prospective points for microwave radio reception.

If I know the coordinates of point "A" and point "B", How can I calculate multiple points between them. Depending upon the terrain, I will need to increase the density of the sampling points.

For example, I know the starting point is at 36.919506, -121.341454. The destination is at 36.919506, -121.341454 .

How can I get the coordinates for points every 200 ft along this path? 500 ft.?

Do more with

EXPERT OFFICE^{®} is a registered trademark of EXPERTS EXCHANGE^{®}

I think it would be useful if you are only interested in the density of the sampling points (for example, you want 25 equidistant points). But if you are looking to space them a certain number of feet apart, it won't do you much good.

If I were you I would ask this question under math & science and algorithims.

Good luck!

036.91950600, -121.34145400

036.91955540, -121.34150860

036.91960480, -121.34156320

036.91965420, -121.34161780

036.91970360, -121.34167240

036.91975300, -121.34172700

036.91980240, -121.34178160

036.91985180, -121.34183620

036.91990120, -121.34189080

036.91995060, -121.34194540

036.92000000, -121.34200000

// converts range of latitude from -90, +90 to 0, 1.

private double NormalFromLatitude(double lat)

{

if (lat < -90 || lat > 90) throw new Exception("Invalid");

return (lat + 90) / 180;

}

// converts range of longitude from -180, +180 to 0, 1.

private double NormalFromLongitude(double

{

if (lon < -180 || lon > 180) throw new Exception("Invalid");

return (lon + 180) / 360;

}

// converts range of latitude from 0,1 to -90, +90.

private double LatitudeFromNormal(double lat)

{

if (lat < 0 || lat > 1) throw new Exception("Invalid");

return (lat * 180) - 90;

}

// converts range of longitude from 0, 1 to -180, +180.

private double LongitudeFromNormal(double

{

if (lon < 0 || lon > 1) throw new Exception("Invalid");

return (lon * 360) - 180;

}

private PointD ToNormalPoint(PointD p)

{

return new PointD(NormalFromLatitude(

}

private PointD FromNormalPoint(PointD normalPoint)

{

return new PointD(LatitudeFromNormal(

}

private void DisplayPoint(PointD normalPoint)

{

PointD p = FromNormalPoint(normalPoin

string s = string.Format("{0:000.0000

DisplayLine(s);

}

private void Main_Load(object sender, EventArgs e)

{

PointD startPoint = new PointD(36.919506, -121.341454);

PointD endPoint = new PointD(36.920, -121.342);

PointD startNormalPoint = ToNormalPoint(startPoint);

PointD endNormalPoint = ToNormalPoint(endPoint);

double dx = endNormalPoint.X - startNormalPoint.X; // get delta x

double dy = endNormalPoint.Y - startNormalPoint.Y; // get delta y

double a = Math.Atan2(dy, dx); // calculate the angle of the line

double cosA = Math.Cos(a); // get the cosine

double sinA = Math.Sin(a); // get the sine

double distance = Math.Sqrt(Math.Pow(dx, 2) + Math.Pow(dy, 2));

int n = 10; // number of points

double distanceBetweenPoints = distance / n;

for (double d = 0; d <= distance; d += distanceBetweenPoints)

{

double x = startNormalPoint.X + d * cosA;

double y = startNormalPoint.Y + d * sinA;

DisplayPoint(new PointD(x,y));

}

}

## Premium Content

You need an Expert Office subscription to comment.Start Free Trial