Jump to content
The simFlight Network Forums

Longitude/Latitude Helper Classes, Feature Request


Delphi

Recommended Posts

Hallo Paul,

currently I'm working on a program which generates map overlays for flight path, filed flight plan, approach and depature procedures. I use your fsuipc.dll for all the coordinates calculation. Works great :-), thanks.

In order to complete my program I would need some additional coordinate calculations as part of your Longitude/Latitude Helper Classes:

 

1. Calculation of a Lat / Lon given by the following descripition (example): Track yyyy (degree) from XXXX (Lat / Lon) until intercepting radial ZZZ (degree) from a given coordinate (Lat / Lon)

 

2. Calculation of a Lat / Lon given by the following descripition (example): Track yyyy (degree) from XXXX (Lat / Lon) until a certain distance (DME) to a given coordinate (Lat / Lon)

 

Would be great if version 3.0 of your fsuipc.dll would have these additional features.

 

Regards,

 

Ruediger

Link to comment
Share on other sites

Hi Ruediger,

 

Ready for testing. New DLL attached. Just overwrite your current DLL and XML files.

 

The new methods added to FsLatLonPoint are:

 

1. For your request #1:

 

 FsLatLonPoint IntersectRadial(double Bearing, FsLatLonPoint Point, double Radial)

 

Calculates the intersection from the current point along the Bearing to where it meets the Radial from the other Point.

 

Check the IsValid property of the point returned to make sure it's valid. Invalid points are generated if the bearing and radial never intersect, or if the intersection is more than 200NM from the Point. This is an arbitrary limit but some limit must be placed or else some results could be hundred of thousands of miles away from the Point which doesn't make sense. I could increase the limit if required.

 

Sample code:

            FsLatLonPoint myPlaneLocation = new FsLatLonPoint();
            FsLatLonPoint vorLocation = new FsLatLonPoint();
            double myBearing = 40;
            double vorRadial = 180;

            // find where the plane (flying bearing 040) will intersect radial 180 of the VOR:
            FsLatLonPoint intersection = myPlaneLocation.IntersectRadial(myBearing, vorLocation, vorRadial);
            if (intersection.IsValid)
            {
                // Do stuff with intersection
            }
            else
            {
                // No intersection possible, or intersection is more than 200NM from VOR
            }

2. For your request #2:

 

FsLatLonPoint IntersectDMENauticalMiles(double Bearing, FsLatLonPoint Point, Double Distance)
FsLatLonPoint IntersectDMEMetres(double Bearing, FsLatLonPoint Point, Double Distance)
FsLatLonPoint IntersectDMEFeet(double Bearing, FsLatLonPoint Point, Double Distance)

 

Calculates the intersection from the current point along the Bearing to where it is the specified Distance from the other Point.

 

Check the IsValid property of the point returned to make sure it's valid. Invalid points are generated if the bearing never goes within the specified distance of the point.

 

Sample code: (using the method for Metres)

            // find where the plane (flying bearing 040) will be 1km from the VOR:
            FsLatLonPoint intersection2 = myPlaneLocation.IntersectDMEMetres(myBearing, vorLocation, 1000);
            if (intersection2.IsValid)
            {
                // Do stuff with intersection
            }
            else
            {
                // No intersection possible. The bearing never comes within 1km of the VOR
            }

Paul

FSUIPCClient3.0_BETA.zip

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.