How do you find the coordinates of intersections of two lines?

So this is a question I got in class and I tried using different methods to find the coordinates of two numbers and it gives me a NaN error.

2 Comments

Post your code..we will find out why it is NaN..
Google is your friend. I also fail to see a specific Matlab question.

Sign in to comment.

Answers (1)

Abhijeet
Abhijeet on 6 Jun 2022
Edited: Abhijeet on 8 Jun 2022
Hi Gautam Kumar
I am assuming that the NaN error in your code is probably due to division by 0.This can happen if given two lines as input are collinear.
For finding coordinates of intersection of two points you can download and use the function line_intersection from MathWorks FIle Exchange .

Categories

Asked:

on 3 Aug 2016

Edited:

on 8 Jun 2022

Community Treasure Hunt

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

Start Hunting!