Rank: 86676 based on 0 downloads (last 30 days) and 0 file submitted
photo

Rodrigo Portugal

E-mail
Lat/Long
58.92021179199219, 5.608199119567871

Personal Profile:
Professional Interests:
image processing, signal processing, geophysics

 

Watch this Author's files

 

Comments and Ratings by Rodrigo View all
Updated File Comments Rating
27 Jan 2010 Fast and Robust Curve Intersections Computes intersection points of two curves. Author: Douglas Schwarz

Douglas,
there is still a little bug related to mismatching dimensions of empty matrices. When we try, for instance,
[xi,yi,i,j] = intersections([0,1],[0,0,],[1,0],[1,1])
that's OK. However, if we try
[xi,yi,i,j] = intersections([0,1],[0,0,],[1,0.5,0],[1,0.5,1])
there is the error "Matrix dimensions should agree", because empty matrices should have compatible dimensions, even though they are empty entities.

So I have look at the code, and I have inserted the following code
i = i(:); j = j(:);
just after "i" and "j" definitions at line 165. In this way it seems that this little annoying bug was removed. Could you check it please?

Personally (and strangely) I am very pleased about this bug, because reading the help on empty matrices I've learned that they have a strong operational structure underneath. As a matter of fact, they behave like non-empty matrices, when we try to make math operations on them!

Congratulations and thanks for the prompt response.

Rodrigo

12 Jan 2010 Fast and Robust Curve Intersections Computes intersection points of two curves. Author: Douglas Schwarz

A really really excellent function. I'm using all the time. However I have a suggestion. When the curves do not interecept, like in this example
[xi,yi,i,j] = intersections([0,1],[0,0,],[1,0],[1,1])
instead to produce an error, it would be better, in my opinion, if it produces empty matrices as an output. This is partially done when the function is called with two outputs, such as,
[xi,yi] = intersections([0,1],[0,0,],[1,0],[1,1])
but not with four. I give you five points anyway!
Rodrigo

Contact us