Find intersection points between lines
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
HAINGKHARRAN GUNASEKARAN
le 14 Juin 2021
Commenté : HAINGKHARRAN GUNASEKARAN
le 14 Juin 2021
Hello, I've plot 5 lines on the same graph with their edge coordinates. Now, I wish to find the intersection point coordinates (xi, yi) from any 2 intersecting lines specifically. Example: Intersection point between bottom slanting line and horizontal straight line.I used polyxpoly function, but it's not working...Is there any better way to do this?. Thank you.
%Bottom slanting line
x1=[1000,1];
y1=[1E-8, 1E-5];
loglog(x1,y1)
hold on
%Top slanting line
x2=[1,3000];
y2=[1E-3,3.5E-7];
loglog(x2,y2)
hold on
%First vertical straight line
x3=[1000, 1000];
y3=[1E-9, 1E-6];
loglog(x3,y3)
hold on
%Second vertical straight line
x4=[3000,3000];
y4=[3.5E-7,1E-9];
loglog(x4,y4)
hold on
%Horizontal straight line
x5=[1,5000];
y5=[3.98E-7,3.98E-7];
loglog(x5,y5)
%Find intersection point
[xi,yi]=polyxpoly(x1,y1,x5,y5)
mapshow(xi,yi,'DisplayType','point','Marker','o')
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots 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!