Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Spirograph online
Message
 
To
11/07/2006 13:25:50
General information
Forum:
Shopping
Category:
Online
Miscellaneous
Thread ID:
01135389
Message ID:
01135429
Views:
16
>>Also Thread #791118
>>
>>>Do you remimber the Spirograph toy. Well here is one online.
>>>
>>>http://www.washington.edu/bibsys/mattf/nina/
>
>If I had VFP on my current machine, I would convert the source code from the site to Fox. Perhaps I will do it for fun this weekend.

Yes, it is fun, in both, coding and running. This may help:
CLEAR

num_lines = 20000	&&integer, number of lines
a_pulse = 200		&& some integer less than num_lines
b_pulse = 5	        &&some integer less than num_lines
*for (count = 0; count < num_lines; count++) {
*  cur_x = cos((-2*PI*a_pulse*count)/num_lines) +
 *         cos((-2*PI*b_pulse*count)/num_lines);
*  cur_y = sin((-2*PI*a_pulse*count)/num_lines) +
 *         sin((-2*PI*b_pulse*count)/num_lines);
* draw line from (prev_x, prev_y) to (cur_x, cur_y)
 *prev_x = cur_x; prev_y = cur_y;
*
prev_x = 0
prev_y = 0
for icount= 0 to num_lines
	cur_x = cos((-2*PI()*a_pulse*icount)/num_lines) +;
         cos((-2*PI()*b_pulse*icount)/num_lines)

	cur_y = sin((-2*PI()*a_pulse*icount)/num_lines) +;
         sin((-2*PI()*b_pulse*icount)/num_lines)
	cur_x=cur_x *200
	cur_y=cur_y *200

	_screen.line(prev_x, prev_y, cur_x, cur_y)

	prev_x = cur_x
	prev_y = cur_y
endfor
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform