Plot a circle onto a 3d graph

조회 수: 22 (최근 30일)
PenguinForce
PenguinForce 2017년 9월 4일
답변: Image Analyst 2021년 9월 13일
If I wanted to plot a filled in black circle at a specific coordinate, with no specific radius, say at x = 50, y= 55, z =60, how would I go about doing this? I want to use the plot3 function but that is as far as I can get.
plot3(50,55, 60);

채택된 답변

KSSV
KSSV 2017년 9월 4일
C = [50,55, 60] ; % center of circle
R = 1. ; % Radius of circle
teta=0:0.01:2*pi ;
x=C(1)+R*cos(teta);
y=C(2)+R*sin(teta) ;
z = C(3)+zeros(size(x)) ;
patch(x,y,z,'k')
hold on
plot3(C(1),C(2),C(3),'*r')
  댓글 수: 1
PenguinForce
PenguinForce 2017년 9월 4일
Thank you for helping me. I tried doing something similar to this earlier but I didn't think about using the patch function

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2021년 9월 13일
Try this:
ellipsoid(0,-0.5,0.5,6,3.25,0.01)
zlim([0,1]);

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by