ฉันกำลังพยายามแสดงภาพเรขาคณิต 3 มิติของเซลล์เม็ดเลือดแดงด้วยฟังก์ชันต่อไปนี้
z = (+-)7.82*sqrt(1-4*(x^2+y^2)/(7.82*7.82))*(0.0518 + 2.0026*(x^2+y^2)/(7.82*7.82)-4.491*((x^2+y^2)/(7.82*7.82))^2)
ฉันต้องการกระจายจุดบนเรขาคณิตแบบสุ่ม จากนั้นใช้ฟังก์ชันสามเหลี่ยมเพื่อให้เห็นภาพ ด้านล่างนี้คือโค้ด Matlab ของฉันที่ฉันเขียน มีบางอย่างผิดปกติกับการตั้งค่าคะแนนของฉัน ฉันไม่สามารถรับผลลัพธ์ของแนวคิดได้ ฉันคิดว่าปัญหาคือฉันไม่รู้วิธีเลือกช่วงพารามิเตอร์ x,y
% coefficent defination
D_0 = 7.82;
a_0 = 0.0518;
a_1 = 2.0026;
a_2 = -4.491;
D_0_sq = D_0*D_0;
% number of points to be added
numpts = 100;
% coordination compuation
%thetha = rand(numpts,1)*2*pi;
%phi = rand(numpts,1)*pi;
x = rand(numpts,1);
y = rand(numpts,1);
z = D_0*sqrt(1-4*(x.^2 + y.^2)/D_0_sq).*(a_0 + a_1*(x.^2 + y.^2)/D_0_sq + ...
(a_2*(x.^2 + y.^2).*(x.^2 + y.^2))/(D_0_sq*D_0_sq));
z_2 = - D_0*sqrt(1-4*(x.^2 + y.^2)/D_0_sq).*(a_0 + a_1*(x.^2 + y.^2)/D_0_sq + ...
(a_2*(x.^2 + y.^2).*(x.^2 + y.^2))/(D_0_sq*D_0_sq));
%D_0*sqrt(1-4*x_sq_y_sq/D_0_sq)*(a_0 + a_1*x_sq_y_sq/D_0_sq + (a_2*x_sq_y_sq*x_sq_y_sq)/(D_0_sq*D_0_sq));
% triangulation computation
dt = DelaunayTri(x,y,z);
dt_2 = DelaunayTri(x,y,z_2);
[tri Xb] = freeBoundary(dt);
[tri_2 Xb_2] = freeBoundary(dt_2);
% plot geometry
trisurf(tri,Xb(:,1),Xb(:,2),Xb(:,3), 'FaceColor', 'cyan', 'faceAlpha', 0.8);
hold on;
trisurf(tri_2,Xb_2(:,1),Xb_2(:,2),Xb_2(:,3), 'FaceColor', 'cyan', 'faceAlpha', 0.8);
ขอบคุณล่วงหน้า!
sqrt(1-4*(x.^2+y.^2))
ดังนั้นx
และy
จะต้องอยู่ภายในวงกลมรัศมี 1/2 ของจุดกำเนิดทั้งคู่ นั่นคือx.^2+y.^2<=1/4
อาจมีข้อจำกัดอื่นๆ - person David   schedule 01.10.2014