| ²é¿´: 214 | »Ø¸´: 2 | |||
| µ±Ç°Ö÷ÌâÒѾ´æµµ¡£ | |||
| ¡¾Óн±½»Á÷¡¿»ý¼«»Ø¸´±¾Ìû×Ó£¬²ÎÓë½»Á÷£¬¾ÍÓлú»á·ÖµÃ×÷Õß dxyhn1979 µÄ 2 ¸ö½ð±Ò | |||
dxyhn1979Òø³æ (СÓÐÃûÆø)
|
[½»Á÷]
¡¾ÇóÖú¡¿·ÇÏßÐÔ·½³ÌµÄÇó¶à¸ùµÄÊýÖµ·½·¨£¿
|
||
|
ÇëÎʸ÷λ´óϺ£º Å£¶Ù·¨£¬Å£¶ÙÏҽط¨ÄÜÇó·ÇÏßÐÔ·½³ÌµÄ¶à¸ùô£¿Çó·ÇÏßÐÔ·½³ÌµÄ¶à¸ùÓ¦ÓÃʲôÊýÖµ·½·¨£¿ |
» ²ÂÄãϲ»¶
338Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´
320Çóµ÷¼Á
ÒѾÓÐ5È˻ظ´
324Çóµ÷¼Á
ÒѾÓÐ4È˻ظ´
085404×Ü·Ö289£¬Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
Ó¢Ò»ÊýÒ»408£¬×Ü·Ö284£¬¶þÕ½Õæ³ÏÇóµ÷¼Á
ÒѾÓÐ15È˻ظ´
Çóµ÷¼Á²»Ìôרҵ
ÒѾÓÐ3È˻ظ´
0854Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
344²ÄÁÏÓ뻯¹¤µ÷¼Á
ÒѾÓÐ5È˻ظ´
317·Ö Ò»Ö¾Ô¸ÄÏÀí¹¤²ÄÁϹ¤³Ì ±¾¿Æºþ¹¤´ó Çóµ÷¼Á
ÒѾÓÐ13È˻ظ´
271·ÖÇóµ÷¼ÁѧУ
ÒѾÓÐ10È˻ظ´
hitzhang
ľ³æ (ÕýʽдÊÖ)
- ·ÂÕæEPI: 1
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ¹ó±ö: 2.15
- ½ð±Ò: 1376.7
- É¢½ð: 969
- ºì»¨: 8
- Ìû×Ó: 862
- ÔÚÏß: 226.4Сʱ
- ³æºÅ: 390575
- ×¢²á: 2007-06-02
- ÐÔ±ð: GG
- רҵ: ÎÞ»ú·Ç½ðÊôÀàµç½éÖÊÓëµç½â
¡ï
dxyhn1979(½ð±Ò+4):ÏÈлÁ˸çÃÇ£¬Ïȸø¼¸¸ö±Ò±Ò£¬ÎÒÊÔÊÔ 2010-03-17 14:01
adu886886(½ð±Ò+1):ллÌṩÒâ¼û 2010-03-17 14:27
dxyhn1979(½ð±Ò+4):ÏÈлÁ˸çÃÇ£¬Ïȸø¼¸¸ö±Ò±Ò£¬ÎÒÊÔÊÔ 2010-03-17 14:01
adu886886(½ð±Ò+1):ллÌṩÒâ¼û 2010-03-17 14:27
|
¸øÄã¸öº¯Êý 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
dxyhn1979
Òø³æ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ¹ó±ö: 0.01
- ½ð±Ò: 5
- É¢½ð: 20
- Ìû×Ó: 80
- ÔÚÏß: 68.1Сʱ
- ³æºÅ: 710673
- ×¢²á: 2009-02-27
- ÐÔ±ð: GG
- רҵ: ĤÉúÎﻯѧÓëĤÉúÎïÎïÀíѧ
3Â¥2010-03-17 14:31:04














»Ø¸´´ËÂ¥
,P(2,