Calculate the coordinate of intersection point between a line parallel to Y axis and any other straight line
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sososasa
am 20 Mär. 2014
Kommentiert: Sososasa
am 21 Mär. 2014
Hi everyone,
How to calculate the coordinates of intersection point between a line parallel to Y axis and any other straight line
Is there a built in function in matlab for such a thing ?
0 Kommentare
Akzeptierte Antwort
Roger Stafford
am 21 Mär. 2014
There is no specific function to do that, but matlab has the next best thing, namely, matrix division. I'll generalize your question. Suppose the two straight lines satisfy the two equations
a*x + b*y = c
d*x + e*y = f
Then their intersection, which is to say the solution to the equations, is given by column vector [x,y] as:
[x;y] = [a b;d e]\[c;f]
Your line parallel to the y-axis is a special case with a = 1, b = 0, and c = some desired constant value of x.
If your lines are determined by pairs of points on the lines, first find their associated equations and then do the above.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!