Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Applying Math with Python

You're reading from   Applying Math with Python Practical recipes for solving computational math problems using Python programming and its libraries

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781838989750
Length 358 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Sam Morley Sam Morley
Author Profile Icon Sam Morley
Sam Morley
Sam Morley Sam Morley
Author Profile Icon Sam Morley
Sam Morley
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Basic Packages, Functions, and Concepts 2. Mathematical Plotting with Matplotlib FREE CHAPTER 3. Calculus and Differential Equations 4. Working with Randomness and Probability 5. Working with Trees and Networks 6. Working with Data and Statistics 7. Regression and Forecasting 8. Geometric Problems 9. Finding Optimal Solutions 10. Miscellaneous Topics 11. Other Books You May Enjoy

Visualizing two-dimensional geometric shapes

The focus of this chapter is on two-dimensional geometry, so our first task is to learn how to visualize two-dimensional geometric figures. Some of the techniques and tools mentioned here might be applicable to three-dimensional geometric figures, but generally, this will require more specialized packages and tools.

A geometric figure, at least in the context of this book, is any point, line, curve, or closed region (including the boundary) whose boundary is a collection of lines and curves. Simple examples include points and lines (obviously), rectangles, polygons, and circles.

In this recipe, we will learn how to visualize geometric figures using Matplotlib.

Getting ready

For this recipe, we need the NumPy package imported as np, and the Matplotlib pyplot module imported as plt. We also need to import the Circle class from the Matplotlib patches module and the PatchCollection class from the Matplotlib...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime