/// <summary>
 /// Creates a new instance of the <see cref="GreatCircleSegment"/> struct with the given points defininf it.
 /// </summary>
 /// <param name="start">The start coordinate of the segment.</param>
 /// <param name="end">The end coordinate of the segment.</param>
 public GreatCircleSegment(SphereCoordinate start, SphereCoordinate end)
 {
     Start = start;
     End = end;
     BaseCircle = new GreatCircle(start, end);
     Length = CalculateArcLength(start, end);
 }
Пример #2
0
 /// <summary>
 /// Creates a new instance of the <see cref="GreatCircleSegment"/> struct with the given points defininf it.
 /// </summary>
 /// <param name="start">The start coordinate of the segment.</param>
 /// <param name="end">The end coordinate of the segment.</param>
 public GreatCircleSegment(SphereCoordinate start, SphereCoordinate end)
 {
     Start      = start;
     End        = end;
     BaseCircle = new GreatCircle(start, end);
     Length     = CalculateArcLength(start, end);
 }
        /// <summary>
        /// Creates a new instance of the <see cref="GreatCircleSegment"/> struct with the given points defining it.
        /// </summary>
        /// <param name="baseCircle">The <see cref="GreatCircle"/> that this segment is part of.</param>
        /// <param name="start">The start coordinate of the segment.</param>
        /// <param name="end">The end coordinate of the segment.</param>
        public GreatCircleSegment(GreatCircle baseCircle, SphereCoordinate start, SphereCoordinate end)
            : this(start, end)
        {
            if (!baseCircle.IsOnCircle(start) || !baseCircle.IsOnCircle(end))
                throw new ArgumentOutOfRangeException("Start and End have to be on the baseCircle.");

            BaseCircle = baseCircle;
        }
Пример #4
0
        /// <summary>
        /// Creates a new instance of the <see cref="GreatCircleSegment"/> struct with the given points defining it.
        /// </summary>
        /// <param name="baseCircle">The <see cref="GreatCircle"/> that this segment is part of.</param>
        /// <param name="start">The start coordinate of the segment.</param>
        /// <param name="end">The end coordinate of the segment.</param>
        public GreatCircleSegment(GreatCircle baseCircle, SphereCoordinate start, SphereCoordinate end)
            : this(start, end)
        {
            if (!baseCircle.IsOnCircle(start) || !baseCircle.IsOnCircle(end))
            {
                throw new ArgumentOutOfRangeException("Start and End have to be on the baseCircle.");
            }

            BaseCircle = baseCircle;
        }
Пример #5
0
        /// <summary>
        /// Checks whether the given <see cref="GreatCircle"/> intersects with this one.
        /// One point of intersection can then be found in the out-Parameter, the other is the antipodal point to it.
        /// </summary>
        /// <param name="other">The other <see cref="GreatCircle"/>.</param>
        /// <param name="intersection">The point of intersection, if they intersect.</param>
        /// <returns>Whether the two <see cref="GreatCircle"/>s intersect or not.</returns>
        public bool Intersects(GreatCircle other, out CartesianVector intersection)
        {
            // http://www.boeing-727.com/Data/fly%20odds/distance.html

            intersection = default(CartesianVector);

            if (this == other)
            {
                return(false);
            }

            intersection = DefinitionVector.CrossProduct(other.DefinitionVector).AsUnitVector;

            return(true);
        }
Пример #6
0
 /// <summary>
 /// Creates a new instance of the <see cref="VoronoiCell"/> class with the given center and sides.
 /// </summary>
 /// <param name="center">The point used as center for Voronoi calculations. Assumed to be inside.</param>
 /// <param name="firstPart">The <see cref="GreatCircle"/> that makes the first part of the Polygon.</param>
 public VoronoiCell(SphereCoordinate center, GreatCircle firstPart)
 {
     Center = center;
     FirstPart = firstPart;
 }
Пример #7
0
        /// <summary>
        /// Checks whether the given <see cref="GreatCircle"/> intersects with this one.
        /// One point of intersection can then be found in the out-Parameter, the other is the antipodal point to it.
        /// </summary>
        /// <param name="other">The other <see cref="GreatCircle"/>.</param>
        /// <param name="intersection">The point of intersection, if they intersect.</param>
        /// <returns>Whether the two <see cref="GreatCircle"/>s intersect or not.</returns>
        public bool Intersects(GreatCircle other, out CartesianVector intersection)
        {
            // http://www.boeing-727.com/Data/fly%20odds/distance.html

            intersection = default(CartesianVector);

            if (this == other)
                return false;

            intersection = DefinitionVector.CrossProduct(other.DefinitionVector).AsUnitVector;

            return true;
        }