using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Drawing3d;
using Drawing3d.Math;
using Drawing3d.Devices;
using Drawing3d.Curves;
using Drawing3d.Editors;

namespace HelloWorld
{
    public partial class Form1 : Form
    {

        CoordinateAxes CoordinateAxes = new CoordinateAxes();
        Curve CustomCurve = new Curve();
        public OpenGlDevice Device = new OpenGlDevice();
        xyzArray A = new xyzArray(5);
        public Form1()
        {
   
            InitializeComponent();
        }

        
        
        private void Form1_Load(object sender, EventArgs e)
        {

            CustomCurve.OnGetValue += new RealFunction2d(CustomCurve_OnGetValue);
            Device.WinControl = this;
            Device.OnPaint += new EventHandler(Device_OnPaint);
            Device.Navigate = NavigateKind.ZoomRotateTrans;
            Device.BackColor = Color.White;
            Device.Lighting = false;
            CoordinateAxes.Parent = Device.Work;
        }
        xy CustomCurve_OnGetValue(object sender, double t)
        {
            t = (t-0.5) * 2.5;
            return new xy(4*(t * t - 1),4* t * (t * t - 1));
        
        }
        void Device_OnPaint(object sender, EventArgs e)
        {
            Device.PenWidth = 2;
            Device.drawCurve(CustomCurve);
            Device.PenWidth = 1;
        }

    }
}