Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- //By ajusting these pareters you can create all kinds of Lissajous figures. Just like the ones you get with a calculator.
- corners = 360; //Increse for larger figures.
- x_centre = room_width/2; //X-coordinate of the centre.
- y_centre = room_height/2; //Y-coordinate of the centre.
- x_amplitude = 300; //How far on the x-axis goes the figure from the centre.
- y_amplitude = 300; //How far on the y-axis goes the figure from the centre.
- x_rotations_per_cycle = 1; //How often does the figure go across the x-axis per cycle. Do not set to 0. Using non round numbers result in unfinished figures
- y_rotations_per_cycle = 1; //How often does the figure go across the y-axis per cycle. Do not set to 0. Same ratios give the same figure.
- x_period = 0; //Does the figure begin at the centre (0) or somewhere else (below 2*pi). Setting these just right also results in unfinished figures.
- y_period = 0; //Does the figure start at the centre (0) or somewhere else (below 2*pi).
- x_direction = 1; //At the beginning, does the figure go right(1) or left (-1)
- y_direction = -1; //At the beginning, does the figure go up (-1) or down (1).
- thickness = 2; //The tickness of the outline.
- cycle_runrhrough = 1; //How often hould the cycle be run.
- for(i=1; i<(x_rotations_per_cycle*y_rotations_per_cycle*cycle_runrhrough*corners); i=i+1){
- draw_line_width(x_centre+x_amplitude*x_direction*sin(x_rotations_per_cycle*(x_period + 2*pi)*(i/(x_rotations_per_cycle*y_rotations_per_cycle*corners))), y_centre+y_amplitude*y_direction*sin(y_rotations_per_cycle*(y_period + 2*pi)*(i/(x_rotations_per_cycle*y_rotations_per_cycle*corners))), x_centre+x_amplitude*x_direction*sin(x_rotations_per_cycle*(x_period + 2*pi)*((i+1)/(x_rotations_per_cycle*y_rotations_per_cycle*corners))), y_centre+y_amplitude*y_direction*sin(y_rotations_per_cycle*(y_period + 2*pi)*((i+1)/(x_rotations_per_cycle*y_rotations_per_cycle*corners))), thickness);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement