March 2001
Intermediate to advanced
400 pages
8h 35m
English
This section shows how to program in Sling. Playing with Sling is fun. You can start the Sling IDE with
> java sjm.examples.sling.SlingIde
Sling lets you plot mathematical functions by issuing plot commands. The namesake of Sling is the sling() function, which takes two arguments: the length of the sling strap, and the number of times the sling goes around (one's head). For example, to plot the path of a sling whose strap length is 1 and that travels three-quarters of a revolution, run the class SlingIde and enter the Sling program
plot sling(1, .75);
Click the Go! button in the IDE or press the Ctrl and G keyboard keys to make the program execute. Figure 16.1 shows the results.
Read now
Unlock full access