Borrar filtros
Borrar filtros

How to draw-project routes of lines on a plane after rotating them

2 visualizaciones (últimos 30 días)
Vasilis
Vasilis el 9 de Jul. de 2015
Comentada: Vasilis el 9 de Jul. de 2015
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.

Respuestas (1)

Mike Garrity
Mike Garrity el 9 de Jul. de 2015
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 comentario
Vasilis
Vasilis el 9 de Jul. de 2015
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

Iniciar sesión para comentar.

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by