How to draw-project routes of lines on a plane after rotating them
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, i try to to solve the problem mentioned below.
I have two lines which can be considered as the two sides a & b ( ---> /\ ) of a triangle (c is the base side). These lines are defined by (x, y) points in x-axis and y-axis. I want to perform some kind of rotation with specific theta (lets say, pi). Why i need to do this? All i want is to draw the "route" of the rotated lines so as to be designed the basis of a cone in a new plane (lets say z-axis). e.g: calipers writes on a piece of paper designing the basis of a cone.
Thanks in advance.
0 件のコメント
回答 (1 件)
Mike Garrity
2015 年 7 月 9 日
If the goal is just to draw the lines, then hgtransform is a good solution. You would do something like this:
g = hgtransform;
line([0 1],[0 0],'Parent',g,'Color','red')
line([0 sqrt(2)/2],[0 sqrt(2)/2],'Parent',g,'Color','blue')
Then you can rotate it like so:
g.Matrix = makehgtform('zrotate',pi/3);
The makehgtform command has a lot of options for different types of transformations, and it returns a matrix that you can use to transform the points of your lines yourself if you want to do more than just draw them. But the matrix is a 4x4. The idea is that you pad out the coordinates of your lines with 1's until it's a four element vector.
参考
カテゴリ
Help Center および File Exchange で Object Containers についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!