04-04-2004, 08:50 PM
Pages: 1 2
04-04-2004, 08:54 PM
CIRCLE can be used to draw curves. Look it up in QBHELP.
04-05-2004, 12:06 AM
Thats not a way of answering a question.
Heres an example:
Thats borrowed from qb v7.1's help =P
Have a look at the aspect ratio part
Heres an example:
Code:
CONST PI=3.141593
SCREEN 2
'Draw a circle with the upper-left quarter missing.
'Use negative numbers so radii are drawn.
CIRCLE (320,100), 200,, -PI, -PI/2
'Use relative coordinates to draw a circle within the missing quarter.
CIRCLE STEP (-100,-42),100
'Draw a small ellipse inside the circle.
CIRCLE STEP(0,0), 100,,,, 5/25
'Display the drawing until a key is pressed.
LOCATE 25,1 : PRINT "Press any key to end.";
DO
LOOP WHILE INKEY$=""
Thats borrowed from qb v7.1's help =P
Have a look at the aspect ratio part
04-05-2004, 12:38 AM
for curves, courtesy of myself and dav's lovely code post:
http://home.carolina.rr.com/davs/codepos...BEZIER.BAS
Bezier curves are curves based on 4 points, which draw a line between two of the points, and pulling towards the other two points. It's a pretty handy tool for systematic calculation of the curves. Shame you either have to use floating or fixed point decimal values to use it, though.
http://home.carolina.rr.com/davs/codepos...BEZIER.BAS
Bezier curves are curves based on 4 points, which draw a line between two of the points, and pulling towards the other two points. It's a pretty handy tool for systematic calculation of the curves. Shame you either have to use floating or fixed point decimal values to use it, though.
04-05-2004, 07:47 AM
lines and point-by-point drawing are definetly "better" than the CIRCLE command of QB.
Anonymous
04-05-2004, 01:38 PM
Quote:lines and point-by-point drawing are definetly "better" than the CIRCLE command of QB.
I totally agree. And GOTO is definitely "better" than SUB, right nyahaha
04-05-2004, 10:06 PM
no.
04-06-2004, 01:44 AM
A faster way to calculate curves is to derivate it n times until it no longer has any variables with exponent. This means derivating twice with quadrics, three times with cubics etc. Then in the loop calculate the change as a series of additions.
dy = y(x + k) - y(x)
ddy = dy(x + k) - dy(x)
then
for i = 0 to steps-1
y = y + dy
dy = dy + ddy
next i
Simple really, but fast.
dy = y(x + k) - y(x)
ddy = dy(x + k) - dy(x)
then
for i = 0 to steps-1
y = y + dy
dy = dy + ddy
next i
Simple really, but fast.
04-06-2004, 04:59 AM
Yeah, that's a good way to go about it Blitz. Except chances are no one is going to understand you until they've taken several Calculus courses and been programming for a few years.
04-06-2004, 12:50 PM
Aga, its not that difficult. Anyone with a basic understanding of calculus and i mean *understanding* not just the formulae can easily program it =).
The advanced stuff doesnt kick in until you are integrating 2D surfaces with double integrals and 3D with triple integrals =P. Thats 'hard' to understand. But its simple *if* and only *if* you have the knowledge of what an integral/derivative of a function *is*
The advanced stuff doesnt kick in until you are integrating 2D surfaces with double integrals and 3D with triple integrals =P. Thats 'hard' to understand. But its simple *if* and only *if* you have the knowledge of what an integral/derivative of a function *is*
Pages: 1 2