Ver Mensaje Individual
  #2  
Antiguo 08-06-2005
frudolph frudolph is offline
Miembro
 
Registrado: oct 2004
Posts: 40
Reputación: 0
frudolph Va por buen camino
Necesitás un control del tipo "TPaintBox" en tu Formulario de, digamos: 400 x 200 pixels; y un botón. Después, probá con este código a ver si te sirve:

procedure TForm1.Button1Click(Sender: TObject);
var
n: Integer;
g: Extended;
Hasta: Integer;
MaxAmplitudY: Integer;
begin
Hasta := 360;
MaxAmplitudY := 45;
PaintBox1.Canvas.MoveTo(0, 100);
for n := 1 to Hasta do
begin
g := (2 * (Pi / Hasta)) * n;
PaintBox1.Canvas.LineTo(n, 100 + Round(Sin(g) * MaxAmplitudY));
end;
end;
Responder Con Cita