How to find coordinates of a line?
4 ビュー (過去 30 日間)
古いコメントを表示
I have a line which is bisected by some orthogonal lines. Now i want to know the start and the end coordinates of those orthogonal lines. Picture is attached for reference. And further i want to divide all the eight orthogonal lines in 10 equidistant points.
0 件のコメント
回答 (1 件)
Image Analyst
2015 年 8 月 17 日
You have to know the length of the crossing lines and the endpoints of the main line. After that, it's just high school algebra.
With the main line endpoints, use linspace(x1, x2, 10) and linspace(y1, y2, 10) to get the crossing points.
Then use the algebra with your line length to get all the other endpoints. Use the point-slope formula. Hint: the slope of a crossing line is -1/(slope of the main line). Is this homework? I didn't want to do all of it for you because it sounds a lot like homework, plus it's so simple you should be able to do it yourself.
3 件のコメント
John D'Errico
2015 年 8 月 17 日
As Image Analyst says, it really is jut a bit of basic algebra. Sit down and define the points that you want to use to define the line endpoints. What do you know about them?
Cedric
2015 年 8 月 17 日
If you know the components of a vector, e.g x = [3,2], what is the easiest way to define an orthogonal vector with same norm?
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!