Rank: 4 based on 3948 downloads (last 30 days) and 52 files submitted
photo

John D'Errico

E-mail
Company/University
Retired

Personal Profile:

Mainly retired from Eastman Kodak. (Of course, Kodak itself is now semi-retired. I don't think I had any influence in that.) I still write MATLAB code as I find something interesting, but I DON'T answer your questions, and I do NOT do homework. Your homework is YOUR problem, not mine. Do NOT e-mail me with your homework problems or student projects. When I'm not doing something with MATLAB, you might find me playing bridge.

Professional Interests:
Bridge, MATLAB, numerical analysis, mathematical modeling

 

Watch this Author's files

 

Files Posted by John View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
16 Oct 2014 movingstd(x,k,windowmode) A (fast) windowed std on a time series Author: John D'Errico movingavg, standard deviation, std, window, filter 134 18
  • 4.75
4.8 | 12 ratings
14 Oct 2014 HPF - a big decimal class High precision floating point arithmetic, a new class written in MATLAB Author: John D'Errico hpf, multiple precision, big decimal, floating point, arithmetic, mathematics 66 20
  • 5.0
5.0 | 9 ratings
23 May 2014 Screenshot A suite of minimal bounding objects Suite of tools to compute minimal bounding circles, rectangles, triangles, spheres, incircles, etc. Author: John D'Errico miminum, bound, bounding, circle, rectangle, triangle 109 18
  • 4.71429
4.7 | 7 ratings
29 Apr 2014 polyfitn Polynomial modeling in 1 or n dimensions Author: John D'Errico polyfit, modeling, regression, linear regression, approximation, function 257 43
  • 4.96
5.0 | 25 ratings
29 Apr 2014 Screenshot SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico spline, splines, cubic, hermite, breaks, knots 194 103
  • 5.0
5.0 | 52 ratings
Comments and Ratings by John View all
Updated File Comments Rating
20 Oct 2014 A suite of minimal bounding objects Suite of tools to compute minimal bounding circles, rectangles, triangles, spheres, incircles, etc. Author: John D'Errico

Hi Tom,

The problem is as you point out, that the insphere code uses a dot product to find the distance to each facet. Then it is a simple call to linprog, with one slack variable for each facet.

A similar idea for edges though trips up becasue each edge has two normals. So then the distance to each edge is now the sqrt of the sum of squares of a pair of dot products. While I can avoid the sqrt, such a formulation would involve quadratic equality constraints for each slack variable. Clearly this is not solvable by linprog, or even quadprog. Fmincon would be needed, so a bit more nasty of a problem using a similar formulation to the one in insphere. Certainly one could use the existing insphere code to find decent starting values for such an iterative solution, but it is still a bit more work.

I'll need to think if there is another scheme that might apply.

John

16 Oct 2014 movingstd(x,k,windowmode) A (fast) windowed std on a time series Author: John D'Errico

Uploaded a new version to replace strmatch

14 Oct 2014 HPF - a big decimal class High precision floating point arithmetic, a new class written in MATLAB Author: John D'Errico

Yes, that was indeed a bug, now fixed. I'm uploading a new version now (to appear today I hope.)

So with the new release, in 100 digits of precision...

exp(hpf('-2.22222222222222222222222222e-137',100))
ans =
1

And in 200 digits, we see a tiny difference from 1, as expected.

exp(hpf('-2.22222222222222222222222222e-137',200))
ans =
0.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999997777777777777777777777777780000000000000000000000000000000000000

This release adds one new toy: the rat function, implemented for hpf. So for a 100 digit rational fraction approximation to pi...

[N,D] = rat(hpf('pi',100),hpf('1e-101'))
N =
394372834342725903069943709807632345074473102456264
D =
125532772013612015195543173729505082616186012726141

N/D
ans =
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068

hpf('pi',100)
ans =
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068

10 Oct 2014 quadratic equation interpolation assume you have a quadratic equation y=ax^2+bx+c.This script determines a, b , c Author: Sherif Omran

abc = polyfit(x,y,2);

would suffice as well. Polyfit is a bit higher quality code too, and it comes with MATLAB since the last 30 years or so. And polyfit has much more capability.

I do find it somewhat laughable that the code fits a QUADRATIC polynomial, but the picture posted shows a curve fit through 4 points, that is clearly NOT quadratic. Hey, it is that new math I suppose. What will they think of next?

And finally, while the title of the submission says something about interpolation, it does no interpolation for you at all.

30 Sep 2014 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico

Sorry. I've never heard of a Java implementation. Not that it counts, I've written it 7 times in MATLAB, once each in Fortran and APL, those last were very old though. The difference each time was what I learned from the previous incarnation. Were someone to do a Java implementation perhaps the most important thing is to use sparse linear algebra capabilities for the solve, else it would take forever.

Comments and Ratings on John's Files View all
Updated File Comment by Comments Rating
20 Oct 2014 A suite of minimal bounding objects Suite of tools to compute minimal bounding circles, rectangles, triangles, spheres, incircles, etc. Author: John D'Errico D'Errico, John

Hi Tom,

The problem is as you point out, that the insphere code uses a dot product to find the distance to each facet. Then it is a simple call to linprog, with one slack variable for each facet.

A similar idea for edges though trips up becasue each edge has two normals. So then the distance to each edge is now the sqrt of the sum of squares of a pair of dot products. While I can avoid the sqrt, such a formulation would involve quadratic equality constraints for each slack variable. Clearly this is not solvable by linprog, or even quadprog. Fmincon would be needed, so a bit more nasty of a problem using a similar formulation to the one in insphere. Certainly one could use the existing insphere code to find decent starting values for such an iterative solution, but it is still a bit more work.

I'll need to think if there is another scheme that might apply.

John

20 Oct 2014 A suite of minimal bounding objects Suite of tools to compute minimal bounding circles, rectangles, triangles, spheres, incircles, etc. Author: John D'Errico Tranter, Tom

Hi John,
Thanks for this submission, it's helped me a lot with a problem I'm working on. I was wondering if the insphere function could be adapted to find the largest sphere bound within the edges of the polygon rather than the faces, as if the polygon were a cage with the sphere bulging through the hollow faces. I'm not too sure how to approach this as the edge normals are not defined in 3D.
Thanks,
Tom

18 Oct 2014 Color name identification: fuzzycolor Efficient identification of color names for any RGB Author: John D'Errico Cobeldick, Stephen

I wrote a color identifier function to convert between RGB and colornames:

http://www.mathworks.com/matlabcentral/fileexchange/48155

The user can choose the to match RGB values using least-squares, or one of the color-difference methods CMC2:1, CIE76, or CIE94 (the default). A bonus function is also included that demonstrates that differences between these matching methods. For more info on these methods, see also: https://en.wikipedia.org/wiki/Color_difference

16 Oct 2014 HPF - a big decimal class High precision floating point arithmetic, a new class written in MATLAB Author: John D'Errico Hoang, Thai V.

Thanks for your quick response. Unfortunately, I still cannot get the updated version from the official download today. Could you please send it to me somehow? Thank you!

16 Oct 2014 movingstd(x,k,windowmode) A (fast) windowed std on a time series Author: John D'Errico D'Errico, John

Uploaded a new version to replace strmatch

Contact us