Find intersection point of two lines inside a circle

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

 Réponse acceptée

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

1 commentaire

Hi Image Analyst, I appreciate you getting back to me. Cheers.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by