How to draw a fixed line based on Orientaion
Good day
Where a user clicks a line or must be drawn showing the orientation
Where the user clicks I store its point in an array
I have another array with different orientations
How do I draw a Fixed line of length(3)[arrow] from 1 point in the direction of the orientation
Idea on how to go about doing it
Regards
Re: How to draw a fixed line based on Orientaion
By keeping the coordinate of the other axis?
Cheers,
_
Re: How to draw a fixed line based on Orientaion
Basically, my idea is
After user clicks a point
I have to create another point in the orientation from the initial point
and draw a line between them
Is there a function out there
that accepts Initial point, and an orientation -> showOrientation(1stPoint, Orientation)
and does the math?
Re: How to draw a fixed line based on Orientaion
Orientation as in Qt::Orientation?
Btw, you will also need a distance
Cheers,
_
Re: How to draw a fixed line based on Orientaion
Sloved! it was more of a math problem
my solution:
Code:
newEndPoint.setX(x1 + length*cos(theta));
newEndPoint.setY(y1 + (length*sin(theta)));
Kind Regards