Ejemplo n.º 1
0
        /// <summary>
        /// Provides information about if the point lies in the circle.
        /// </summary>
        /// <param name="circle2D">The circle.</param>
        /// <param name="point">The point.</param>
        /// <returns>
        /// <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Unknown"/> if status is unknown.
        /// <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Disjoint"/> if the point lies outside the circle.
        /// <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Overlap"/> if the point lies inside or on the circle edge.
        /// Additionally to Overlap: <see cref="Kanji.DesktopApp.Interfaces.AreaCode.AEnclosesB"/> if the point lies inside and not on the edge.
        /// Additionally to Overlap and AEnclosesB: <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Identical"/> if the point equals the centre point of the circle.
        /// Additionally to Overlap: <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Tangents"/> if the point lies on the edge of the circle.
        /// </returns>
        public static AreaCode Intersect(Circle2D circle2D, Point point)
        {
            AreaCode retval = AreaCode.Unknown;

            if (circle2D.Centre.Distance((Point)point) < circle2D.Radius)
            {
                retval = AreaCode.Overlap | AreaCode.AEnclosesB;
            }
            else if (circle2D.Centre.Equals(point))
            {
                retval = AreaCode.Overlap | AreaCode.AEnclosesB | AreaCode.Identical;
            }
            else if (circle2D.Centre.Distance((Point)point) == circle2D.Radius)
            {
                retval = AreaCode.Overlap | AreaCode.Tangents;
            }
            else
            {
                retval = AreaCode.Disjoint;
            }

            return(retval);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Provides information about if the stroke intersects the circle.
 /// </summary>
 /// <param name="stroke">The stroke.</param>
 /// <returns>
 /// <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Unknown"/> if status is unknown.
 /// <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Disjoint"/> if the stroke lies outside the circle.
 /// <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Overlap"/> if the stroke lies inside, intersects or is a tangent of the circle.
 /// Additionally to Overlap: <see cref="Kanji.DesktopApp.Interfaces.AreaCode.AEnclosesB"/> if the stroke lies completely inside the circle.
 /// Additionally to Overlap: <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Intersect"/> if the stroke intersects the circle.
 /// Additionally to Overlap: <see cref="Kanji.DesktopApp.Interfaces.AreaCode.Tangents"/> if the stroke is a tangent of the circle.
 /// </returns>
 public static AreaCode Intersect(Circle2D circle2D, IStroke stroke)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 internal static AreaCode Intersect(Rectangle2D rectangle2D, Circle2D circle2D)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public static AreaCode Intersect(Circle2D circle2D, Rectangle2D rectangle2D)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public static AreaCode Intersect(Circle2D circle2D, Square2D square2D)
 {
     return(Area.Intersect(circle2D, square2D as Rectangle2D));
 }