Example #1
0
        public void SetUp()
        {
            _controlSize = new Size(0, 0);
            _viewExtent  = new Rect(0, 0, 0, 0);
            _plotCenter  = new Point(0, 0);
            _plotExtent  = new Rect(0, 0, 0, 0);
            _scale       = 1d;
            _plotSize    = 0d;

            _calculator = new GeometryCalculator();
        }
    public void PackChordsToCircle(float radius_, float chordeLength_)
    {
        if (radius_ * 2 < chordeLength_ ||
            radius_ <= 0 ||
            chordeLength_ <= 0)
        {
            SceneDirector.Instance.ShowInputWarning();
            return;
        }
        radius       = radius_;
        chordeLength = chordeLength_;
        GeometryCalculator calc = new GeometryCalculator();

        chordeAngle  = (float)calc.CalculateCenterAngle(radius, chordeLength);
        offestLength = chordeLength * OFFSET_MODIFIER;
        offsetAngle  = (float)calc.CalculateCenterAngle(radius, offestLength);
        double quotient = 2 * Math.PI / (offsetAngle + chordeAngle);

        setsPackedCount = (int)Math.Floor(quotient);
        SceneDirector.Instance.ReportResult(this);
    }