Board index » delphi » draw sin and cos

draw sin and cos

does anybody know how to draw sin or cos smoothly?!,
I tried to draw in TChart but the result was not good...
please help me...
 

Re:draw sin and cos


for i:=o to image.width-1 do
 image.canvas.pixels[x,(image.height div 2)+(image.height div 2)*sin(2*pi*i/image.width)]:=clred;

Rene

Quote
Maulana I Kahirawan wrote:

> does anybody know how to draw sin or cos smoothly?!,
> I tried to draw in TChart but the result was not good...
> please help me...

Re:draw sin and cos


Quote
Rene Tschaggelar <tschagge...@access.ch> wrote in message news:371D7A00.2D7DF55A@access.ch...
> for i:=o to image.width-1 do
>  image.canvas.pixels[x,(image.height div 2)+(image.height div 2)*sin(2*pi*i/image.width)]:=clred;

Using the Pixels property will be very slow.  MoveTo/Line will be a lot faster.

efg
________________________________
efg's Computer Lab:       www.efg2.com/lab
Delphi Books:  www.efg2.com/lab/TechBooks/Delphi.htm

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

Re:draw sin and cos


thank's for your advise....

Rene Tschaggelar <tschagge...@access.ch> wrote in article
<371D7A00.2D7DF...@access.ch>...

Quote
> for i:=o to image.width-1 do
>  image.canvas.pixels[x,(image.height div 2)+(image.height div

2)*sin(2*pi*i/image.width)]:=clred;
Quote

> Rene

> Maulana I Kahirawan wrote:

> > does anybody know how to draw sin or cos smoothly?!,
> > I tried to draw in TChart but the result was not good...
> > please help me...

Other Threads