Creating a plane normal to an ellipsoid
Ältere Kommentare anzeigen
I need to plot a plane normal to a specified point on an ellipsoid and am having issues doing so. I am currently able to plot a line normal, but have not been able to figure out how to create the plane. The ellipsoid is defined as below and the matrices Rc_matrix and N_matrix define points on the ellipsoid touching the plane and the planar normal vector, respectively.
n1=6;
xr=0.05;
yr=0.05;
zr=0.05;
N<=35
[X,Y,Z] = ellipsoid(obst_pos(1,1),obst_pos(2,1),obst_pos(3,1),xr,yr,zr);
surf(X,Y,Z)
hold on
for i1=1:N
plot3(Rc_matrix(n1*i1-5),Rc_matrix(n1*i1-4),Rc_matrix(n1*i1-3),'ro'); % plots point on plane normal to ellipsoid
q = [-N_matrix(i1, n1*i1-5);N_matrix(i1, n1*i1-4);N_matrix(n1*i1-3)]/5;
plot3([Rc_matrix(n1*i1-5)-q(2),Rc_matrix(n1*i1-5)+q(2)],[Rc_matrix(n1*i1-4)-q(1),Rc_matrix(n1*i1-4)+ q(1)],[Rc_matrix(n1*i1-3)-q(3),Rc_matrix(n1*i1-3)+q(3)],'r-')
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!