Page 1 of 1

Polybezier() - How to draw a sinus/cosinus?

Posted: Mon Jan 14, 2008 9:32 pm
by eriansa
title says it all.

i need the points coordinates.

Posted: Mon Jan 14, 2008 9:58 pm
by Derek
This help at all?

Code: Select all

OpenWindow(0,0,0,800,600,"",$ca0001)
InitSprite()
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0)

*points=AllocateMemory(2*4*4)
PokeL(*points,100);start
PokeL(*points+4,100)

PokeL(*points+8,300);control
PokeL(*points+12,20)

PokeL(*points+16,500);control
PokeL(*points+20,580)

PokeL(*points+24,700);end
PokeL(*points+28,500)
hdc=StartDrawing(ScreenOutput())
FrontColor(#White)
PolyBezier_(hdc,*points,4)
StopDrawing()

Repeat
Until WaitWindowEvent()=16

Posted: Mon Jan 14, 2008 11:22 pm
by eriansa
Not exactly, the curve is not complete.

Perhaps a mathematical formula to calculate those points?
I am a math noob...

Posted: Mon Jan 14, 2008 11:27 pm
by Derek
Can you explain a bit better what you want, is it just a sin wave?

Posted: Mon Jan 14, 2008 11:46 pm
by eriansa
Well, I thought there could be some mathematical function to calculate the points needed, to let the PolyBezier_() Api function draw an exact sine wave.

Sure I can start drawing and find the points more or less, but a function would be much easier :wink:

Posted: Fri Feb 08, 2008 10:23 pm
by hellhound66
Removed.

Posted: Sat Feb 09, 2008 2:16 am
by eriansa
Calculates Sin-values. Really.
Sure, but that's not the question :wink: