±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 214  |  »Ø¸´: 2
µ±Ç°Ö÷ÌâÒѾ­´æµµ¡£
¡¾Óн±½»Á÷¡¿»ý¼«»Ø¸´±¾Ìû×Ó£¬²ÎÓë½»Á÷£¬¾ÍÓлú»á·ÖµÃ×÷Õß dxyhn1979 µÄ 2 ¸ö½ð±Ò

dxyhn1979

Òø³æ (СÓÐÃûÆø)

[½»Á÷] ¡¾ÇóÖú¡¿·ÇÏßÐÔ·½³ÌµÄÇó¶à¸ùµÄÊýÖµ·½·¨£¿

ÇëÎʸ÷λ´óϺ£º
Å£¶Ù·¨£¬Å£¶ÙÏҽط¨ÄÜÇó·ÇÏßÐÔ·½³ÌµÄ¶à¸ùô£¿Çó·ÇÏßÐÔ·½³ÌµÄ¶à¸ùÓ¦ÓÃʲôÊýÖµ·½·¨£¿
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

hitzhang

ľ³æ (ÕýʽдÊÖ)

¡ï
dxyhn1979(½ð±Ò+4):ÏÈлÁ˸çÃÇ£¬Ïȸø¼¸¸ö±Ò±Ò£¬ÎÒÊÔÊÔ 2010-03-17 14:01
adu886886(½ð±Ò+1):ллÌṩÒâ¼û 2010-03-17 14:27
ÒýÓûØÌû:
Originally posted by dxyhn1979 at 2010-03-17 10:39:14:
ÇëÎʸ÷λ´óϺ£º
Å£¶Ù·¨£¬Å£¶ÙÏҽط¨ÄÜÇó·ÇÏßÐÔ·½³ÌµÄ¶à¸ùô£¿Çó·ÇÏßÐÔ·½³ÌµÄ¶à¸ùÓ¦ÓÃʲôÊýÖµ·½·¨£¿

¸øÄã¸öº¯Êý
function P = InterX(L1,varargin)
%INTERX Intersection of curves
%   P = INTERX(L1,L2) returns the intersection points of two curves L1
%   and L2. The curves L1,L2 can be either closed or open and are described
%   by two-row-matrices, where each row contains its x- and y- coordinates.
%   The intersection of groups of curves (e.g. contour lines, multiply
%   connected regions etc) can also be computed by separating them with a
%   column of NaNs as for example
%
%         L  = [x11 x12 x13 ... NaN x21 x22 x23 ...;
%               y11 y12 y13 ... NaN y21 y22 y23 ...]
%
%   P has the same structure as L1 and L2, and its rows correspond to the
%   x- and y- coordinates of the intersection points of L1 and L2. If no
%   intersections are found, the returned P is empty.
%
%   P = INTERX(L1) returns the self-intersection points of L1. To keep
%   the code simple, the points at which the curve is tangent to itself are
%   not included. P = INTERX(L1,L1) returns all the points of the curve
%   together with any self-intersection points.
%   
%   Example:
%       t = linspace(0,2*pi);
%       r1 = sin(4*t)+2;  x1 = r1.*cos(t); y1 = r1.*sin(t);
%       r2 = sin(8*t)+2;  x2 = r2.*cos(t); y2 = r2.*sin(t);
%       P = InterX([x1;y1],[x2;y2]);
%       plot(x1,y1,x2,y2,P(1,,P(2,,'ro')

%   Author : NS
%   Version: 2.0, 26/11/09

%   Two words about the algorithm: Most of the code is self-explanatory.
%   The only trick lies in the calculation of C1 and C2. To be brief, this
%   is essentially the two-dimensional analog of the condition that needs
%   to be satisfied by a function F(x) that has a zero in the interval
%   [a,b], namely
%           F(a)*F(b) <= 0
%   C1 and C2 exactly do this for each segment of curves 1 and 2
%   respectively. If this condition is satisfied simultaneously for two
%   segments then we know that they will cross at some point.
%   Each factor of the 'C' arrays is essentially a matrix containing
%   the numerators of the signed distances between points of one curve
%   and line segments of the other.

    %...Argument checks and assignment of L2
    error(nargchk(1,2,nargin));
    if nargin == 1,
        L2 = L1;    hF = @lt;   %...Avoid the inclusion of common points
    else
        L2 = varargin{1}; hF = @le;
    end
      
    %...Preliminary stuff
    x1  = L1(1,';  x2 = L2(1,;
    y1  = L1(2,';  y2 = L2(2,;
    dx1 = diff(x1); dy1 = diff(y1);
    dx2 = diff(x2); dy2 = diff(y2);
   
    %...Determine 'signed distances'
    S1 = dx1.*y1(1:end-1) - dy1.*x1(1:end-1);
    S2 = dx2.*y2(1:end-1) - dy2.*x2(1:end-1);
            
    C1 = feval(hF,D(bsxfun(@times,dx1,y2)-bsxfun(@times,dy1,x2),S1),0);
    C2 = feval(hF,D((bsxfun(@times,y1,dx2)-bsxfun(@times,x1,dy2))',S2'),0)';
     
    %...Obtain the points where an intersection is expected
    [i,j] = find(C1 & C2);
    dx2=dx2'; dy2=dy2';  
    L = dy2(j).*dx1(i) - dy1(i).*dx2(j);
    i = i(L~=0); j=j(L~=0); L=L(L~=0);  %...Avoid divisions by 0
        
    %...Solve system of eqs to get the common points
    P = unique([dx2(j).*S1(i) - dx1(i).*S2(j)', ...
                dy2(j).*S1(i) - dy1(i).*S2(j)']./[L L],'rows')';
              
    function u = D(x,y)
        u = bsxfun(@minus,x(:,1:end-1),y).*bsxfun(@minus,x(:,2:end),y);
    end
end
2Â¥2010-03-17 11:41:18
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

dxyhn1979

Òø³æ (СÓÐÃûÆø)

¿´²»¶®°¡¡£ÄܽâÊÍÒ»ÏÂô£¿
3Â¥2010-03-17 14:31:04
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ dxyhn1979 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 274Çóµ÷¼Á +8 ˳Àí³ÉÕÅ 2026-04-03 9/450 2026-04-03 14:10 by zhangdingwa
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +14 Ò»ÑùYWY 2026-04-02 14/700 2026-04-03 13:48 by baoball
[¿¼ÑÐ] »·¾³285·Ö£¬¹ýÁù¼¶£¬Çóµ÷¼Á +9 xhr12 2026-04-02 9/450 2026-04-03 10:23 by »¯Ñ§»¯¹¤Ë¶Ê¿ÕÐÉ
[¿¼ÑÐ] 283·Ö²ÄÁÏÓ뻯¹¤Çóµ÷¼Á +20 ÂÞKAKA 2026-04-02 20/1000 2026-04-03 08:32 by tianyyysss
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +8 ÀÁÑòÑòÇáÖÃÓñÍÎ 2026-04-02 8/400 2026-04-02 22:03 by liu823948201
[¿¼ÑÐ] 348Çóµ÷¼Á +11 zzzzyk123 2026-04-01 11/550 2026-04-02 16:52 by Wang200018
[¿¼ÑÐ] 282Çóµ÷¼Á +18 ycy1201 2026-04-01 20/1000 2026-04-02 16:39 by liumengping
[¿¼ÑÐ] 26¿¼Ñе÷¼Á +4 Wnz.20030617 2026-04-01 5/250 2026-04-02 16:11 by 1939136013¹·×³
[¿¼ÑÐ] 290Çóµ÷¼Á085701 +3 1314Åõ»¨ 2026-04-02 3/150 2026-04-02 13:34 by Ecowxq666£¡
[¿¼ÑÐ] Çóµ÷¼ÁÍÆ¼ö +3 ÄÏɽÄÏ@ 2026-04-01 3/150 2026-04-02 12:09 by xiaoranmu
[¿¼ÑÐ] 0856³õÊÔ324·ÖÇóµ÷¼Á +6 ÏëÉÏѧÇóµ÷ 2026-04-01 6/300 2026-04-02 11:42 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 324Çóµ÷¼Á +5 ÏëÉÏѧÇóµ÷ 2026-04-01 6/300 2026-04-02 10:16 by sanrepian
[¿¼ÑÐ] 270µ÷¼Á +7 maxjxbsk 2026-04-02 7/350 2026-04-02 09:50 by yulian1987
[¿¼ÑÐ] 301Çóµ÷¼Á +13 A_JiXing 2026-04-01 13/650 2026-04-02 09:01 by sanrepian
[¿¼ÑÐ] ¡¾Çóµ÷¼Á¡¿085601²ÄÁϹ¤³Ìר˶ | ×Ü·Ö272 | +10 ½Å»¬µÄÊØ·¨¹«Ãñ 2026-03-27 10/500 2026-04-01 17:23 by pies112
[¿¼ÑÐ] ±¾¿Æ211ÉúÎïҽѧ¹¤³Ì085409Çóµ÷¼Á339·Ö +7 Àï×Óľyy 2026-03-29 7/350 2026-03-31 14:35 by fmesaito
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐʦ·¶»¯Ñ§332·ÖÇóµ÷¼Á +3 Lyy930824@ 2026-03-29 3/150 2026-03-30 20:15 by DHUSHUAI
[¿¼ÑÐ] ±§Ç¸ +3 ÌïºéÓÐ 2026-03-30 3/150 2026-03-30 19:11 by ÃÔºýCCPs
[¿¼ÑÐ] 105500ҩѧÇóµ÷¼Á£¬Ò»Ö¾Ô¸É½¶«´óѧҩѧ£¬348·Ö +3 gr¹þ¹þ¹þ 2026-03-28 3/150 2026-03-30 18:56 by Ô´_2020
[¿¼ÑÐ] 285Çóµ÷¼Á +4 AZMK 2026-03-27 7/350 2026-03-27 20:59 by AZMK
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û