How to draw every type of triangle?

조회 수: 5 (최근 30일)
Yashlin Naidoo
Yashlin Naidoo 2015년 5월 25일
답변: Image Analyst 2015년 5월 25일
I was only able to generate a equilateral triangle with my code below;
%Triangle=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
sides = 3;
t = (1/(2*sides):1/(sides):1)*2*pi-pi/3;
b = User_input(3);
x = b*sin(t)+5/8*xmax;
y = b*cos(t)+3/4*ymax;
fill(x,y,'black');
  댓글 수: 1
Jan
Jan 2015년 5월 25일
Notice that we cannot guess what you want to achieve and what "User_input(3)" is. So please edit the question and append more information.

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

답변 (1개)

Image Analyst
Image Analyst 2015년 5월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by