Plotting triangle and finding its vertices

1 vue (au cours des 30 derniers jours)
Emmanuel
Emmanuel le 30 Mai 2014
hi!! I want to plot these lines, find the point of intersection formed by these lines. The plot is not intersecting these, though they should graphically. How do I make them intersect and find the vertices formed?
[x1] = input('Enter the value of 1st coord');
[y1] = input('Enter the value of 2nd coord');
t = linspace(0,1);
xa = x1(1)+ (y1(1)-x1(1))*t;
ya = y1(1) + (y1(2)-x1(2))*t;
[x2] = input('Enter the value of 1st coord');
[y2] = input('Enter the value of 1st coord');
u = linspace(0,1);
xb = x2(1)+ (y2(1)-x2(1))*u;
yb = y2(1) + (y2(2)-x2(2))*u;
[x3] = input('Enter the value of 1st coord');
[y3] = input('Enter the value of 1st coord');
v = linspace(0,1);
xc = x3(1)+(y3(1)-x3(1))*v;
yc = y3(1)+(y3(2)-x3(2))*v;
plot(xa,ya,xb,yb,xc,yc);

Réponses (0)

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by