参考:
http://school.itzcn.com/special-spid-12.html
上面有关于这方面的信息,楼主可以看看,希望对你有所帮助。

解决方案 »

  1.   

    也许我语文不够好吧
    看不懂你的题目>.<
    能不能画个草图说明下...
      

  2.   

    条件不是很清楚
    如果矩形形状相同,而且是刚好放进去的话
    那椭圆的高可以通过方程求出来
    假设矩形宽是a,高是b,间距是c,椭圆'宽'是x1,'高'是y1.那么(a, b*N+c*(N-1)/2 )这个点在椭圆上,直接带入椭圆方程就可以得到这个椭圆的参数椭圆参数有了那么每个矩形的位置也就可以固定了……
      

  3.   

    问题已经解决了,现在才贴出来,希望有遇到类似问题的朋友有一点帮助//该项目中有输入和输出两种模块,Input是输入模块,显示在椭圆的左半圆,
                //Output是输出模块,显示在椭圆的右半圆。
                //graphWidth 当前模块的宽, graphHeight当前模块的高
                Point center = new Point(graphWidth / 2, graphHeight / 2);            //输入/输出小方块边长
                //int sideLength = 10;            double radiusX = (graphWidth - inOutHeight) * 0.5;
                double radiusY = (graphHeight - inOutHeight) * 0.5;            double x = 0;
                double y = 0;            foreach (Input ef in InputCollection)
                {
                    inputIndex++;
                    double inputAngle;
                    if (inputCount > 1)
                    {
                        inputAngle = 2 * Math.PI / (inputCount + outputCount);
                        // 位置
                        double angle = inputIndex * inputAngle / 2;
                        x = center.X - radiusX * Math.Sin(angle) - inOutHeight;
                        y = center.Y + radiusY * Math.Cos(angle) - inOutHeight;
                    }
                    else
                    {
                        inputAngle = 2 * Math.PI / inputCount;
                        // 位置
                        double angle = inputIndex * inputAngle;
                        x = center.X - radiusX * Math.Cos(angle) - inOutHeight / 2;
                        y = center.Y - radiusY * Math.Sin(angle) - inOutHeight / 2;
                    }
                    ef.PositionX = x + graphLeft;
                    ef.PositionY = y + graphTop;                Canvas.SetLeft(ef, ef.PositionX);
                    Canvas.SetTop(ef, ef.PositionY);
                }            foreach (Output ef in OutputCollection)
                {
                    outputIndex++;
                    double outputAngle;
                    if (outputCount > 1)
                    {
                        outputAngle = 2 * Math.PI / (inputCount + outputCount);                    // 位置
                        double angle = outputIndex * outputAngle / 2;
                        x = center.X + radiusX * Math.Sin(angle) - inOutHeight;
                        y = center.Y + radiusY * Math.Cos(angle) - inOutHeight;
                    }
                    else
                    {
                        outputAngle = 2 * Math.PI / outputCount;
                        // 位置
                        double angle = outputIndex * outputAngle;
                        x = center.X + radiusX * Math.Cos(angle) - inOutHeight / 2;
                        y = center.Y + radiusY * Math.Sin(angle) - inOutHeight / 2;
                    }
                    ef.PositionX = x + graphLeft;
                    ef.PositionY = y + graphTop;                Canvas.SetLeft(ef, ef.PositionX);
                    Canvas.SetTop(ef, ef.PositionY);
                }