public TrajectoryPart(ProjectionBase projection, GeoPoint startPoint, GeoPoint endPoint, double speedInKmH)
            {
                this.startPointField = startPoint;
                this.endPointField   = endPoint;
                Size   sizeInKm   = projection.GeoToKilometersSize(startPoint, new Size(Math.Abs(startPoint.Longitude - endPoint.Longitude), Math.Abs(startPoint.Latitude - endPoint.Latitude)));
                double partlength = Math.Sqrt(sizeInKm.Width * sizeInKm.Width + sizeInKm.Height * sizeInKm.Height);

                flightTimeField = partlength / speedInKmH;
                courseField     = Math.Atan2((endPoint.Longitude - startPoint.Longitude), (endPoint.Latitude - startPoint.Latitude)) * 180 / Math.PI;
            }
            public GeoPoint GetPointByCurrentFlightTime(double currentFlightTime, ProjectionBase projection)
            {
                if (currentFlightTime > FlightTime)
                {
                    return(endPointField);
                }
                double ratio = currentFlightTime / FlightTime;

                return(new GeoPoint(startPointField.Latitude + ratio * (endPointField.Latitude - startPointField.Latitude), startPointField.Longitude + ratio * (endPointField.Longitude - startPointField.Longitude)));
            }
示例#3
0
 public static Query Add(this Query query, ProjectionBase projection)
 {
     Argument.NotNull(query, "query");
     Argument.NotNull(projection, "projection");
     return(new Query(query.Select.Add(projection), query.From, query.Where));
 }
示例#4
0
 void Start()
 {
     projectionBase   = (GameObject)GameObject.Instantiate(Resources.Load <GameObject>("PreFabs/Gravity/ProjectionBase"));
     projectionScript = projectionBase.GetComponent <ProjectionBase>();
     projectionScript.Initialize(this.gameObject, projectionNodes);
 }