How to draw every type of triangle?

3 Ansichten (letzte 30 Tage)
Yashlin Naidoo
Yashlin Naidoo am 25 Mai 2015
Beantwortet: Image Analyst am 25 Mai 2015
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 Kommentar
Jan
Jan am 25 Mai 2015
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 25 Mai 2015

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by