|
MRaster examples 23.0.0.0
Image Processing Library
|
Draw the roots of paramaterized polynomials. More...
Go to the source code of this file.
Draw the roots of paramaterized polynomials.
Copyright (c) 2025, Mitchell Jay Richling http://www.mitchr.me/ All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Plot roots of the polynomial p. Two of the coefficients of p (c1 & c2) are parameterized by polynomials (p2 & p2) over the unit circle.
In pseudo-code: Loop Select sample points on the unit circle for t1 & t2 Plug t1 & t2 into p1 & p2 Set coefficients c1 & c2 in p to the value of p1 & p2 Find the roots of p and plot them Repeat
I made a prototype for this problem in Matlab. In the Matlab code I placed semitransparent filled circles at each root, and allowed color to build up with repeated layers of roots. This results in a "fuzzy" look spreading color more smoothly over the envelope of the root cloud. That code may be found here: https://github.com/richmit/PolyRootCloud/
In this code I wanted to emphasize more directly the way the circles in the parametrization map to the root cloud space. So I'm actually creating a histogram of root hits in the plane with a very fine grid, and using many more sample points on one parameter. This produces a Spirograph'esq effect.
Definition in file poly_root_cloud.cpp.