첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
0.01MB

▶ MainForm.cs

using System;
using System.Drawing;
using System.Windows.Forms;

using Steema.TeeChart.Drawing;
using Steema.TeeChart.Styles;

namespace TestProject
{
    /// <summary>
    /// 메인 폼
    /// </summary>
    public partial class MainForm : Form
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainForm()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            Text = "TChart 클래스 : Walls 속성을 사용해 벽 투명도 설정하기";

            this.tChart.Aspect.View3D             = true;
            this.tChart.Panel.Pen                 = new ChartPen(Color.Black);
            this.tChart.Walls.Left.Transparency   = 90;
            this.tChart.Walls.Left.Color          = Color.Yellow;
            this.tChart.Walls.Bottom.Transparency = 0;
            this.tChart.Walls.Bottom.Color        = Color.Yellow;

            Surface surface = new Surface(this.tChart.Chart);

            for(int x = -10; x <= 10; ++x)
            {
                for(int z = -10; z <= 10; ++z)
                {
                    surface.Add(x, Calculate(x, z), z);
                }
            }
        }

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region 계산하기 - Calculate(x, y)

        /// <summary>
        /// 계산하기
        /// </summary>
        /// <param name="x">X</param>
        /// <param name="y">Y</param>
        /// <returns>계산값</returns>
        private double Calculate(double x, double y)
        {
            const double a = 3.0;
            const double b = 10.0;
            const double c = 5.0;
            const double d = 1.0;

            x = x / 3.0;
            y = y / 3.0;

            double result = a * Math.Pow(d - x, 2) * Math.Exp(-(x * x) - Math.Pow(y + d, 2)) -
                b * (x / c - (x * x * x) - (y * y * y * y * y)) * Math.Exp(-Math.Pow(x, 2) - Math.Pow(y, 2)) -
                (d / a) * Math.Exp(-Math.Pow(x + d, 2) - Math.Pow(y, 2));

            return result;
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요