/// <summary> /// Checks whether a rectangle intersects with this one. /// </summary> /// <param name="other">The rectangle to test.</param> /// <returns>true if <paramref name="other"/> intersects with this one, false otherwise.</returns> public bool Intersects(LatLonBoundaries other) { var latDiff = Math.Abs(other.CenterLatitude.FixCoordinate(true) - this.CenterLatitude); var lonDiff = Math.Abs(other.CenterLongitude.FixCoordinate(false) - this.CenterLongitude); return (Math.Abs(other.CenterLatitude.FixCoordinate(true) - this.CenterLatitude) <= ((this.LatitudeSpan + other.LatitudeSpan) / 2) && Math.Abs(other.CenterLongitude.FixCoordinate(true) - this.CenterLongitude) <= ((this.LongitudeSpan + other.LongitudeSpan) / 2)); }
public DrawContext(UIElement container, RedrawType redrawType, Transform transform, MatrixTransform cumulativeTransform, LatLonBoundaries boundaries, IProjection projection, DisplayType displayType, long animationStep) { this.Container = container; this.RedrawType = redrawType; this.Transform = transform; this.CumulativeTransform = cumulativeTransform; this.Boundaries = boundaries; this.Projection = projection; this.DisplayType = displayType; this.AnimationStep = animationStep; }
private static bool equals(LatLonBoundaries x, LatLonBoundaries y) { return(System.Object.ReferenceEquals(x, y) || (x?.Equals(y) ?? false)); }
/// <summary> /// Checks whether a rectangle is completely inside this one. /// </summary> /// <param name="other">The rectangle to test.</param> /// <returns>true if <paramref name="other"/> is completely inside this one, false otherwise.</returns> public bool Contains(LatLonBoundaries other) { return(other != null && other.LeftNotBound >= this.LeftNotBound && other.RightNotBound <= this.RightNotBound && other.BottomNotBound >= this.BottomNotBound && other.TopNotBound <= this.TopNotBound); }
public LatLonBoundaries(LatLonBoundaries boundaries) : this(boundaries.CenterLatitude, boundaries.CenterLongitude, boundaries.LatitudeSpan, boundaries.LongitudeSpan) { }