x={2+7cos[sinu + sin121u]}cosu pi/2500 < u < 2*pi
The funniest thing is that nobody has tought us about serious programming in any language and they ask us to write code for something like that!
Anyway, I decided to recall my programming memories and knowledge (as much as it can be!) and to try to write a code for it in QBASIC. I have also worked with VBASIC but I don;t know how to draw things on screen! Whereas in QBASIC i use the LINE command to connect two different points and show them directly in the screen.
So, I tried at first to make code that shows the results of a simpler parametric equation such as
y = cos (x)
My problem is that I want to draw each point of (x,y) separately but I dont know which command to use. So I used LINE which draws a line between two points (really!) that are being created in the calculations. The difference between two pairs of (x,y) are very small so the size of the line should be insignificant right? well my screen doesn't agree.
Thats the code I wrote¨
for x = -90 to 89 y = cos(x) x2 = x+1 ' create a second pair due to lack of knowledge of how to design a single point! y2 = cos(x2) SCREEN 1 LINE (x,y) - (x2,y2)
this is supposed to draw the results of y = cos (x)
but the graphics I get are not the way they should.
Sorry for the long post guys, if anybody can help I would appreciate, I can also use Visual Basic if anybody has a proposition to make, thanks!
This post has been edited by newbie69: 19 May 2007 - 02:51 AM

New Topic/Question
Reply




MultiQuote






|