Summary

   



 Download CD Content

Overview

This chapter demonstrates how to define and use ECMAScript functions in order to create SVG documents that are based on polar equations. In this chapter, you will see that there are many ways to manipulate polar equations; the more interesting graphics images are actually a combination of polar equations with other geometric objects, such as ellipses, as well as different color gradients.

The SVG code presented in this chapter uses more complicated ECMAScript functions and also tends to be longer than the examples in previous chapters. In some cases, you'll also see a significant performance penalty. For instance, the CD-ROM for this chapter contains , which generates a graphics image that is based on a Steiner equation. The code in dynamically creates and adds more than 30,000 SVG rect elements in an ECMAScript function, so there's a significant delay involved on most PCs. When the code in was converted to a Java class, the Java code performed roughly 20 times faster than the SVG code on the same PC! Even though Java code is interpreted byte-code, it does not have the overhead of ECMAScript, nor does it need to dynamically create SVG elements. Incidentally, when you launch , it might be interesting to watch the memory consumption on your PC while you wait for the SVG viewer to render the graphics image. All code and images for this chapter can be found on the companion CD-ROM in the Chapter 14 folder.



   



Fundamentals of SVG Programming. Concepts to Source Code
Fundamentals of SVG Programming: Concepts to Source Code (Graphics Series)
ISBN: 1584502983
EAN: 2147483647
Year: 2003
Pages: 362

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net