Home page arrow Projects arrow Conics intersections

Interseting posts

Syndicate

Search

Conics intersections PDF Print E-mail
Written by Pierluigi Taddei   
Sunday, 09 August 2009

I made some small bug fixes to the conic intersection package. Thanks to Dany for pointing the bug out. The matlab code that you can download here can be used to detect the (up to) four intersections of two conics. The usage is quite straightforward but anyway, here is an example:

%%the homogeneous representation of a conic is a matrix
%% m = [A C D; C B E; D E F] that represents the equation
%% A x^2 + B y^2 + 2C xy + 2D x + 2Ey + F = 0


%a circle centered in the origin

E1 = [1 0 0; 0 1 0; 0 0 -3]

%an ellipse centered in the origin

E2 = [1 0 0; 0 3 0; 0 0 -6]

%get the four homogeneous intersections
P = intersectConics(E1, E2)
%plot the normalized points
plot(P(1,:) ./ P(3,:) , P(2,:) ./ P(3,:), 'ro');

You can find this package also at Matlab Central

Algorithm description

The solutions to a two second degree equations system in two variablesmay be seen as the coordinates of the intersections of two genericconic section. In particular two conics may possess none, two, fourpossibly coincident intersection points. The best method to locatethese solutions is to exploit the homogeneous matrix representation ofconic sections, i.e. a 3x3 symmetric matrix which depends on sixparameters.

The procedure to locate the intersection points follows these steps:

  • given the two conics C1 and C2 consider the pencil of conics given by their linear combination λC1 + μC2
  • identify the homogeneous parameters (λ,μ) which corresponds to the degenerate conic of the pencil. This can be done by imposing that detC1 + μC2) = 0, which turns out to be the solution to a third degree equation.
  • given the degenerate cone C0, identify the two, possibly coincident, lines constituting it
  • intersects each identified line with one of the two original conic; this step can be done efficiently using the dual conic representation of C0
  • the points of intersection will represent the solution to the initial equation system

Matlab implementation

In the library you will find a couple of matlab function which implements the above steps tointersect two conics. In particular the main functions are:

  • intersectConics : this is the main function to perform the intersection
  • decomposeDegenerateConic: this function allow to split a degenerate conic into two lines
  • intersecLineConic: this function recover the, possibly two, points of intersection of a line and a conic
If you have any comments please refer to me by email!

 




Share this article
Reddit!Del.icio.us!Slashdot!Technorati!StumbleUpon!Furl!Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated ( Wednesday, 28 July 2010 )
 
Next >

Warning: fopen(/home/pigeico/public_html/components/com_sef/cache/shCacheContent.php) [function.fopen]: failed to open stream: Permission denied in /home/pigeico/public_html/components/com_sef/shCache.php on line 85