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.

回答(1 个)

Mike Garrity
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.
  1 个评论
Vasilis
Vasilis 2015-7-9
After rotating these two lines, all i want is to draw some dots or a curve pointing out the rotation-route of the lines. A good example is exactly what compasses do. Finally, i want to create a binary image and calculate the intrinsic area of the curve. Sorry for my not such comprehensive question.
Thanks in advance

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Object Containers 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by