我需要找出兩個圓的相交點。我有中心點和每個圓的半徑。我需要在MATLAB中完成。任何幫助將不勝感激。MATLAB中兩個圓相交點
1
A
回答
2
找到圓的方程。確保考慮平方根的負數,否則你只會有一個半圓。
將兩個圓的方程設爲等於彼此。
3
假設一個三角形ABC,其中A和B是圓的中心,C是一個或另一個交點。 a,b和c是與相應角落相對的側面。 α,β和γ分別是與A,B和C相關的角度。
然後,b^2 + c^2 -2 * b c cos(alpha)= a^2。瞭解阿爾法(或餘弦),你可以找到C的位置
A = [0 0]; %# center of the first circle
B = [1 0]; %# center of the second circle
a = 0.7; %# radius of the SECOND circle
b = 0.9; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_1 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1-cosAlpha^2));
intersect_2 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1-cosAlpha^2));
intersect_1 =
0.66 -0.61188
intersect_2 =
0.66 0.61188
0
下面是使用兩個文件交換提交一個簡單的代碼:第一 - 畫圓,第二 - 找到交點(以下鏈接)。
clf
N=30; % circle resolution as the number of points
hold on
% draw 1st circle at (0,0) radius 5 and get X and Y data
H1=circle([0 0],5,N);
X1=get(H1,'XData');
Y1=get(H1,'YData');
% draw 2nd circle at (2,5) radius 3 and get X and Y data
H2=circle([2 5],3,N);
X2=get(H2,'XData');
Y2=get(H2,'YData');
% find intersection points
[x,y]=intersections(X1,Y1,X2,Y2,0);
% and plot them as red o's
plot(x,y,'ro')
hold off
axis equal
0
功能CIRCCIRC
可以實現這個要求。
[xout,yout] = circcirc(x1,y1,r1,x2,y2,r2)
這會給你兩個交點。
相關問題
- 1. MATLAB:兩個圓錐曲線的交點
- 2. C++中兩個圓的相交點
- 3. 查找兩個橢圓的交點(Python)
- 4. Matlab:兩條線的交點
- 5. 查找圓相交點的問題
- 6. 查找點時兩個球體相交
- 7. 線和圓相交
- 8. 畫出兩個彼此相交的圓,從那我需要找到使用c的相交點#
- 9. 如何使用Matlab或Excel從兩個表中獲得交點?
- 10. 在Matlab中找到兩個正態分佈的交點
- 11. 如果matlab中兩個矩形的交點爲零
- 12. 在MATLAB一個共同的行元素相交的兩個表
- 13. 3D中的圓圈交點
- 14. CSS中的圓圈交點
- 15. 確定給定圓的兩個扇區是否相交?
- 16. 檢查如果在相同的圓重疊兩段/相交
- 17. 蟒蛇 - 兩個大圓的交點(緯度/長)
- 18. 計算兩個旋轉橢圓的交點
- 19. 在matlab中交換一個圖像中的圓圈像素
- 20. 計算兩個圓上兩點之間的切線圓弧
- 21. 在matlab中連接兩個點
- 22. 如何區分兩個相撞的圓?
- 23. 相交兩個陣列
- 24. 相交兩個詞典
- 25. F#相交兩個列表
- 26. 兩個橢圓(橢圓)的交集區域?
- 27. Ruby中兩點的交點
- 28. 我有一條線從一個圓的中心點到另一個點。我想找到線與圓的圓周相交的點
- 29. 確定圓上兩點之間相對於中心的角度
- 30. 圓錐線段交點2D
謝謝..我知道如何做到這一點的幾何形狀,但是不知道該怎麼辦呢Matlab的,因爲我很新的Matlab的。 – Pow 2011-03-08 22:28:22