How to find the 'y' values of line which is perpendicular to another line?

3 views (last 30 days)
I have (x, y) data of the blue line, and the only the x data of the red points.
I want draw a line which is perpendicular to the blue line so that I can make a patch like image.
But I don't know how to get the two 'y' values of the pair of red points.
Let me know whether there is a formula or a function of MATLAB.
  1 Comment
Jan on 30 May 2022
What do you eactly have? The line consists of an infinite number of points. So I do not think, that you have the data of the line, but maybe the coordinates or the blue dots on this line. Now it would be useful, if you post, in which format these coordinates are stored.
If the blue line has the the normalized direction vector [nx, ny], the lines orthogonal to it have the directions [ny, -nx] and [-ny, nx]. "Perpendicular" means, that the dot product is zero.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by