Format fix 2005/persano/README.md
Also update .gitignore.
This commit is contained in:
1 parent
594958b67f
commit
ab663fd012
2 files changed
+31
-26
No files matched your search
@@ -1 +1,2 @@
|
|||||||
persano
|
persano
|
||||||
|
foo.gif
|
||||||
+30
-26
@@ -1,9 +1,8 @@
|
|||||||
# Best of show
|
# Best of show
|
||||||
|
|
||||||
Mauro Persano
|
Mauro Persano
|
||||||
São Paulo
|
|
||||||
Brazil
|
Brazil
|
||||||
mauro_persano@yahoo.com
|
<mauro_persano@yahoo.com>
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
@@ -23,10 +22,11 @@ make
|
|||||||
./persano 3 16 > knot3-16.gif
|
./persano 3 16 > knot3-16.gif
|
||||||
```
|
```
|
||||||
|
|
||||||
Open the GIF file with a viewer capable of displaying animated GIFs and
|
Open the [GIF](https://en.wikipedia.org/wiki/GIF) file with a viewer capable of
|
||||||
watch closely at the bottom of the picture (you may need to use
|
displaying animated GIFs and watch closely at the bottom of the picture (you may
|
||||||
"gifsicle" - a great tool to manipulate animated GIFs - to slow down the
|
need to use [gifsicle](https://www.lcdf.org/gifsicle/) - a great tool to
|
||||||
animation and to compress the GIFs generated by the entry).
|
manipulate animated GIFs - to slow down the animation and to compress the GIFs
|
||||||
|
generated by the entry).
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
@@ -39,31 +39,32 @@ What needs to be done to fix the problem?
|
|||||||
|
|
||||||
Solving the author's exercises below may or may not help.
|
Solving the author's exercises below may or may not help.
|
||||||
|
|
||||||
At the time of judging, the approximation of π used in the program could
|
At the time of judging, the approximation of
|
||||||
not be found on mathworld.com.
|
[π](https://en.wikipedia.org/wiki/Pi) used in the program could not be found on
|
||||||
|
<https://mathworld.wolfram.com>.
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
### NAME
|
|
||||||
|
|
||||||
**knot**
|
**knot** writes animated GIF images of rendered [torus
|
||||||
> writes animated GIF images of rendered torus knots to standard output.
|
knots](https://en.wikipedia.org/wiki/Torus_knot) to standard output.
|
||||||
|
|
||||||
### SYNOPSIS
|
### SYNOPSIS
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
knot p q [num frames]
|
./persano p q [num frames]
|
||||||
```
|
```
|
||||||
|
|
||||||
### DESCRIPTION
|
### DESCRIPTION
|
||||||
|
|
||||||
A (p,q)-torus knot is a closed, non-intersecting curve on the surface of
|
A (p,q)-[torus knot](https://en.wikipedia.org/wiki/Torus_knot) is a closed,
|
||||||
a torus in R3 that winds p times around one cycle of the torus and q
|
non-intersecting curve on the surface of a
|
||||||
times around the other. p and q should be coprime; otherwise, the
|
[torus](https://en.wikipedia.org/wiki/Torus) in R3 that winds `p` times around
|
||||||
resulting curve will _not_ be a knot (that is, imagining the resulting
|
one cycle of the torus and `q` times around the other. `p` and `q` should be
|
||||||
curve as a loop of rubber, there will be a way to bend, twist and
|
[coprime](https://en.wikipedia.org/wiki/Coprime_integers); otherwise, the
|
||||||
stretch it, without cutting it [1], until it ends up looking just like a
|
resulting curve will _not_ be a knot (that is, imagining the resulting curve as
|
||||||
circle embedded in R3 [2]).
|
a loop of rubber, there will be a way to bend, twist and stretch it, without
|
||||||
|
cutting it [1], until it ends up looking just like a circle embedded in R3 [2]).
|
||||||
|
|
||||||
Sample usage:
|
Sample usage:
|
||||||
|
|
||||||
@@ -72,13 +73,14 @@ Sample usage:
|
|||||||
```
|
```
|
||||||
|
|
||||||
writes a non-animated GIF (a single frame) stream of a rendered trefoil
|
writes a non-animated GIF (a single frame) stream of a rendered trefoil
|
||||||
knot to the file foo.gif.
|
knot to the file `foo.gif`.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./persano 5 2
|
./persano 5 2
|
||||||
```
|
```
|
||||||
|
|
||||||
writes a GIF stream with a rendering of Solomon's Seal knot to standard
|
writes a GIF stream with a rendering of [Solomon's Seal
|
||||||
|
knot](https://en.wikipedia.org/wiki/Solomon%27s_knot) to standard
|
||||||
output; since the number of frames is not specified, an animation with
|
output; since the number of frames is not specified, an animation with
|
||||||
40 frames will be written.
|
40 frames will be written.
|
||||||
|
|
||||||
@@ -91,9 +93,10 @@ The program writes fully valid GIF 89 streams.
|
|||||||
It is suggested that the output be viewed with a program capable of
|
It is suggested that the output be viewed with a program capable of
|
||||||
displaying animated GIFs, such as almost any graphical HTTP browser.
|
displaying animated GIFs, such as almost any graphical HTTP browser.
|
||||||
|
|
||||||
Due to code size constraints, full LZW compression was not implemented
|
Due to code size constraints, full [LZW
|
||||||
[3]. In fact, the output images are even somewhat expanded, thanks to
|
compression](https://en.wikipedia.org/wiki/LZ77_and_LZ78#LZW) was not
|
||||||
GIF overhead.
|
implemented [3]. In fact, the output images are even somewhat expanded, thanks
|
||||||
|
to GIF overhead.
|
||||||
|
|
||||||
The GIF format supports only a limited number of bits per pixel, so the
|
The GIF format supports only a limited number of bits per pixel, so the
|
||||||
program uses ordered dithering to emulate full RGB output.
|
program uses ordered dithering to emulate full RGB output.
|
||||||
@@ -101,7 +104,7 @@ program uses ordered dithering to emulate full RGB output.
|
|||||||
### PORTABILITY
|
### PORTABILITY
|
||||||
|
|
||||||
The program was tested on Linux, with gcc 3.1; Cygwin, with gcc 3.3; and
|
The program was tested on Linux, with gcc 3.1; Cygwin, with gcc 3.3; and
|
||||||
Solaris/Sparc, with Sun's C compiler.
|
Solaris/SPARC, with Sun's C compiler.
|
||||||
|
|
||||||
The only major portability issue should be reliance on ASCII.
|
The only major portability issue should be reliance on ASCII.
|
||||||
|
|
||||||
@@ -116,7 +119,8 @@ smoother by increasing the number of polygons.
|
|||||||
|
|
||||||
2. (2 points) Figure out how to change the radius of the tube cross section.
|
2. (2 points) Figure out how to change the radius of the tube cross section.
|
||||||
|
|
||||||
3. (5 points) Locate the famous transcendental constant π in the code.
|
3. (5 points) Locate the famous transcendental constant
|
||||||
|
[π](https://en.wikipedia.org/wiki/Pi) in the code.
|
||||||
|
|
||||||
### FOOTNOTES
|
### FOOTNOTES
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user