//---------------------------------------------------------------------------
#include
#include
#pragma hdrstop
#include
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
g=new Graficos(Form1->Canvas);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
x1=X;
y1=Y;
xc=X;
yc=Y;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
X2=X;
Y2=Y;
if(RadioButton1->Checked)
{
Edit1->Text=x1;
Edit2->Text=y1;
Edit3->Text=X2;
Edit4->Text=Y2;
g->lineaDDA(x1,y1,X2,Y2);
}
if(RadioButton2->Checked)
{
Edit6->Text=xc;
Edit5->Text=yc;
radio=X2-xc;
Edit7->Text=radio;
//g->circulo_4(X2,Y2,radio) ;
g->circ_coord_polares(x1,y1,radio);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton1Click(TObject *Sender)
{
Form1->Refresh();
Form1->Repaint();
if(RadioButton1->Checked)
{
Edit6->Text=" ";
Edit7->Text=" ";
Edit5->Text=" ";
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioButton2Click(TObject *Sender)
{
Form1->Refresh();
Form1->Repaint();
if(RadioButton2->Checked)
{
Edit1->Text=" ";
Edit2->Text=" ";
Edit3->Text=" ";
Edit4->Text=" ";
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Form1->Refresh();
Form1->Repaint();
int x=ClientWidth/3;
int y=ClientHeight/2;
radio=5;
g->espiral1(x,y,radio);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
Form1->Refresh();
Form1->Repaint();
int x=ClientWidth/3;
int y=ClientHeight/2;
radio=1.0;
g->espiral2(x,y,radio);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button6Click(TObject *Sender)
{
Form1->Refresh();
Form1->Repaint();
int x=ClientWidth/3;
int y=ClientHeight/2;
double teta=7;
double radio=1.2;
//double th=0.3;
g->espiral2efecto(x,y,radio,teta);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender)
{
Form1->Refresh();
Form1->Repaint();
int x=ClientWidth/3;
int y=ClientHeight/2;
double radio=.75;
//double th=0.3;
g->espiral1efecto(x,y,radio);
}
//---------------------------------------------------------------------------
No hay comentarios:
Publicar un comentario