area between three curves
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I want to color the area between the intersection of three curves. Please suggest a way
Code:
T1 = 180:0.1:270;
x1 = 3*cosd(T1); y1 = 3*sind(T1);
T2 = theta_4s2:0.001:theta_4f2;
c1 = 4.3123; c2 = -50.2708; c3 = 193.7277; c4 = -243.8411;
r_6 = c1*T2.^3 + c2*T2.^2 + c3*T2 + c4;
x2 = 1.998 + r_6.*cos(T2); y2 = -0.8840 + r_6.*sin(T2);
x0 = 1.8977; y0 = 2.3235; vr = 4.0678;
beta = atan(y0/x0);
x3 = s2(1,1):0.001:x_t; y3 = y0 + (x0-x3)*cot(beta) - (9.81*(x0-x3).^2)./(2*(vr*sin(beta))^2);
pgon1 = polyshape(x1,y1);
pgon2 = polyshape(x2,y2);
pgon3 = polyshape(x3,y3);
figure (1)
plot(x1,y1,x2,y2,x3,y3)
hold on
plot (intersect(intersect(pgon3,pgon4), pgon3,'EdgeColor','none')
댓글 수: 6
Star Strider
2021년 11월 12일
... still more problems ...
T2 = 3.3620:0.001:3.9045;
T1 = 180:0.1:270;
x1 = 3*cosd(T1); y1 = 3*sind(T1);
T2 = 3.3620:0.001:3.9045;
c1 = 4.3123; c2 = -50.2708; c3 = 193.7277; c4 = -243.8411;
r_6 = c1*T2.^3 + c2*T2.^2 + c3*T2 + c4;
x2 = 1.998 + r_6.*cos(T2); y2 = -0.8840 + r_6.*sin(T2);
x0 = 1.8977; y0 = 2.3235; vr = 4.0678;
beta = atan(y0/x0);
x3 = s2(1,1):0.001:x_t; y3 = y0 + (x0-x3)*cot(beta) - (9.81*(x0-x3).^2)./(2*(vr*sin(beta))^2);
pgon1 = polyshape(x1,y1);
pgon2 = polyshape(x2,y2);
pgon3 = polyshape(x3,y3);
figure (1)
plot(x1,y1,x2,y2,x3,y3)
hold on
plot (intersect(intersect(pgon3,pgon4)), pgon3,'EdgeColor','none')
I would really like to be able to run this in order to see what the problems are.
.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 NaNs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!