MATLAB: Find intersection point of two lines inside a circle

inside a circleintersection pointtwo lines

I have to find and check the intersection point of two lines with additional conditions that the lines intersect inside a circle. Can anybody help? Thank you

Best Answer

Just set the two line equations equal to each other to get the (x,y) of the intersection.
m1*x + b1 = m2*x + b2;
then solve for x, and plug that x back in either equation to get the y. It's trivial 10th grade stuff so I'm sure a smart engineer like you will be able to solve it in seconds. I don't want to insult you by doing it for you. Of course the m's and b's must be given to you so you know the equations of the lines.
Then compute the distance of that from the center to see if it's closer than the radius
if sqrt((x-xCenter)^2 + (y-yCenter)^2) <= radius
% Intersection is inside the circle.
else
% Intersection is not inside the circle.
end
Related Question