Plotting triangle and finding its vertices

5 ビュー (過去 30 日間)
Emmanuel
Emmanuel 2014 年 5 月 30 日
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);

回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by