and Nineto Commands indicated showpage Causes the graphics to be rendered to the page (required if you want to see or print the page). By default, the units for coordinates are points (a point is 1/72...

I am working on a project to create a program containing a main() that uses a recursive function to create a Koch curve. We output cout statements and do output redirection at time of execution to a .ps file and view it there to see the results, how do I calculate the points?and Nineto Commands indicated<br>showpage Causes the graphics to be rendered to the page (required if you want to see or<br>print the page).<br>By default, the units for coordinates are points (a point is 1/72 of an inch); therefore the<br>commands 11 moveto 72 72 lineto stroke Would produce a 1.4 inch diagonal line from the lower<br>left comer. A simple postscript program that draws a level 1 snowflake is (generated by koch 72<br>360 504 360 1):<br>X!PS-Adobe -2.0<br>72<br>360 moveto<br>144<br>O rlineto<br>72 125 rlineto<br>72 -125 rlineto<br>144<br>O rlineto<br>stroke<br>showpage<br>Statement of Work<br>Write a program (yes, that means an entire program, including acpp file with main()) to draw a<br>Koch curve of arbitrary level and with arbitrary starting line segment endpoints using a recursive<br>algorithm. Your program should take the initial line segment endpoints and the desired final level<br>as command line arguments. So, if your executable is named

Extracted text: and Nineto Commands indicated showpage Causes the graphics to be rendered to the page (required if you want to see or print the page). By default, the units for coordinates are points (a point is 1/72 of an inch); therefore the commands 11 moveto 72 72 lineto stroke Would produce a 1.4 inch diagonal line from the lower left comer. A simple postscript program that draws a level 1 snowflake is (generated by koch 72 360 504 360 1): X!PS-Adobe -2.0 72 360 moveto 144 O rlineto 72 125 rlineto 72 -125 rlineto 144 O rlineto stroke showpage Statement of Work Write a program (yes, that means an entire program, including acpp file with main()) to draw a Koch curve of arbitrary level and with arbitrary starting line segment endpoints using a recursive algorithm. Your program should take the initial line segment endpoints and the desired final level as command line arguments. So, if your executable is named "koch" (on Linux/MacOS) or "koch.exe" (on Windows), you would run it as: koch x1 y1 x2 y2 level The first four arguments are the starting line segment endpoints (1,n) and (,n) in page coordinates; the last is the curve level (2 0). Your program should send to cout a Postscript program (which is plain text) to draw the requested curve. If you save this to a file with an extension of pE (using output redirection, for on the command line), you can view the result on MacOS and Linux by double- example with clicking on the .pz file (for Windows, you may need to download Ghostscript (https://www.ghostscript.com/)_to preview Postscript files). You can also preview Postscript files using Google Drive, by saving the file to Drive and then just double-clicking there. 2/13/2022, 1:17 PM Ilround
Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here