Reputation: 11
I have three points a,b,c whose x,y,z coordinates are
a=[ -0.3519052 0 0];
b=[ 0 -0.674984 0];
c=[ 0 0 -0.6485047];
how do plot a plane(triangle) using these three points in scilab plot3d and plo3d1 are not giving the form i am looking for.
Upvotes: 0
Views: 820
Reputation: 11
how to plot triangle in scilab
Plot a triangle using its sides
Consider the fist vertex lies at origin(0,0) Second vertex lies on X-Axis at (a,0)
From distance formula of triangle ie.
length of side = sqrt( (x2−x1)^2+(y2−y1)^2 )
Program to Plot a Triangle when sides are given is as below in scilab :
clf()
//Length of the sides
a = 10;
b = 10
c = 10
//Vertex of third point
xc=(a^2-(b^2-c^2))/(2*a)
yc=sqrt(c^2-xc^2);
clf()
x=[0,0,xc]
y=[0,yc,0]
plot2d(0,0,-1,"010","",[0,0,0,0]);
xpoly(x,y,"lines",1)
Upvotes: 1
Reputation: 11
I figured out the problem! plot3d1 needs column vectors.
plot3d1(a',b',c')
produced the plot
Upvotes: 1