kgk
kgk

Reputation: 659

Draw a triangle in 3D space by Matlab

I have these 3 points:

A=[30,0,0]; 
B=[0,40,0]; 
C=[0,0,10]; 

How can I draw a triangle which has the 3 nodes by A,B,C in 3 dimensional space?

Upvotes: 0

Views: 4881

Answers (1)

M--
M--

Reputation: 29153

You have these points:

A = [30,0,0];
B = [0,40,0];
C = [0,0,10];

Then you can use Plot3d for your purpose:

Plot3d([30,0,0],[0,40,0],[0,0,10])

You can also use fill3:

fill3(A,B,C)

Also you can use patch:

patch(A,B,C,[0,6]) 
%fourth argument gives a gradient of colors, alternatively you can use 'red' or 'blue'

Or as mentioned in the comments, you can use the following:

Search

Upvotes: 2

Related Questions