Table of Content:
- Ellipses
- Arcs
- Drawing polygons
- Building vertices for regular polygons
- We then append the x and y value to our $p array
- Conclusion
Not all graphics on web pages are for design only. A lot of sites used in business or financial reporting need to show dynamic information graphically, and because that information updates constantly, the graphs need to be drawn on the fly. In this weeks tutorial we will continue on with some more complex shapes – curves, ellipses and polygons. We’ll also take a look at some of the maths involved with drawing polygons. As the series progresses, this will lead up to a routine that will plot graphs on the fly from dynamic data.
This tutorial contains some maths, but the code is provided and is suitable for intermediate PHP developers using either Dreamweaver MX or MX 2004.
Allan comes from Cape Town, South Africa. He has been implicated in writing for several WROX, glasshaus, Wiley and Apress publications, generally in the 'cool stuff that PHP can do' sections.
You can catch up with him at his website http://www.mediafrenzy.co.za.