Ejemplo n.º 1
0
        // Token: 0x06000482 RID: 1154 RVA: 0x0001616C File Offset: 0x0001436C
        public static AxisAlignedBox2 ComputeAxisAlignedBoundingBox(this Arc2 arc)
        {
            double minX = arc.Circle.Center.X - arc.Circle.Radius;
            double maxX = arc.Circle.Center.X + arc.Circle.Radius;
            double minY = arc.Circle.Center.Y - arc.Circle.Radius;
            double maxY = arc.Circle.Center.Y + arc.Circle.Radius;

            if (!arc.Contains(Angle.FromDegrees(0.0)))
            {
                maxX = Math.Max(arc.StartPoint.X, arc.EndPoint.X);
            }
            if (!arc.Contains(Angle.FromDegrees(90.0)))
            {
                maxY = Math.Max(arc.StartPoint.Y, arc.EndPoint.Y);
            }
            if (!arc.Contains(Angle.FromDegrees(180.0)))
            {
                minX = Math.Min(arc.StartPoint.X, arc.EndPoint.X);
            }
            if (!arc.Contains(Angle.FromDegrees(270.0)))
            {
                minY = Math.Min(arc.StartPoint.Y, arc.EndPoint.Y);
            }
            return(new AxisAlignedBox2(minX, maxX, minY, maxY));
        }
Ejemplo n.º 2
0
        // Token: 0x060002CF RID: 719 RVA: 0x0000B860 File Offset: 0x00009A60
        internal static bool Contains(Arc2 arc, Vector2 point)
        {
            Angle pointDirectionAngle = arc.Circle.GetPointDirectionAngle(point);

            return(arc.Contains(pointDirectionAngle));
        }