Scilab Function
Last update : 1/11/2005

schnittp - crossing points of two curves

Calling Sequence

Q = schnittp(C1,C2)

Parameters

Description

This function calculates the crossing points of two curves. Therefore, curve segements by sequential points are rebuild as lines and a mathematical solution is derived. Q contains in the 1st row the crossing points, the 2nd row contains the direction vector and the last row the index ps of curve 1, so that the crossing points can also be calculated by C1(ps) + Q(3,ps)*(C1(ps+1)-C1(ps))

Examples

z1=bezier();
// Draw Curve 1, finish with right click (twice)
z2=bezier();
// Draw Curve 2, finish with right click (twice)
// Calculating... please wait
Q=schnittp(z1,z2);
plot2d(real(z1),imag(z1),style=2);
plot2d(real(z2),imag(z2),style=3);
plot2d(real(Q(1,:)),imag(Q(1,:)),style=-3);
// Draw both curves and common points in a graph

See Also

meshgrid ,   bezier ,  

Authors

Dr. Andreas Geissler geisslea@web.de

Used Function

meshgrid