필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Vasilis
Vasilis 2015년 7월 9일
댓글: Vasilis 2015년 7월 9일
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