Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering SciPy
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering SciPy

Mastering SciPy

By : Blanco-Silva, Francisco Javier B Silva
3.5 (2)
close
close
Mastering SciPy

Mastering SciPy

3.5 (2)
By: Blanco-Silva, Francisco Javier B Silva

Overview of this book

The SciPy stack is a collection of open source libraries of the powerful scripting language Python, together with its interactive shells. This environment offers a cutting-edge platform for numerical computation, programming, visualization and publishing, and is used by some of the world’s leading mathematicians, scientists, and engineers. It works on any operating system that supports Python and is very easy to install, and completely free of charge! It can effectively transform into a data-processing and system-prototyping environment, directly rivalling MATLAB and Octave. This book goes beyond a mere description of the different built-in functions coded in the libraries from the SciPy stack. It presents you with a solid mathematical and computational background to help you identify the right tools for each problem in scientific computing and visualization. You will gain an insight into the best practices with numerical methods depending on the amount or type of data, properties of the mathematical tools employed, or computer architecture, among other factors. The book kicks off with a concise exploration of the basics of numerical linear algebra and graph theory for the treatment of problems that handle large data sets or matrices. In the subsequent chapters, you will delve into the depths of algorithms in symbolic algebra and numerical analysis to address modeling/simulation of various real-world problems with functions (through interpolation, approximation, or creation of systems of differential equations), and extract their representing features (zeros, extrema, integration or differentiation). Lastly, you will move on to advanced concepts of data analysis, image/signal processing, and computational geometry.
Table of Contents (11 chapters)
close
close
10
Index

Plane geometry

The geometry module of the SymPy library covers basic geometry capabilities. Rather than giving an academic description of all objects and properties in that module, we discover the most useful ones through a series of small self-explanatory Python sessions.

We start with the concepts of point and segment. The aim is to illustrate how easily we can check for collinearity, compute lengths, midpoints, or slopes of segments, for example. We also show how to quickly compute the angle between two segments, as well as decide whether a given point belongs to a segment or not. The following diagram illustrates an example, which we will follow up with the code:

Plane geometry
In [1]: from sympy.geometry import Point, Segment, Line, \
   ...:                            Circle, Triangle, Curve
In [2]: P1 = Point(0, 0); \
   ...: P2 = Point(3, 4); \
   ...: P3 = Point(2, -1); \
   ...: P4 = Point(-1, 5)
In [3]: statement = Point.is_collinear(P1, P2, P3); \
   ...: print "Are P1, P2, P3 collinear...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY