mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 210
S
saxon Offline OP
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Apr 2003
Posts: 210
Hi, I have a dot in a picture window. I want to draw a straight line coming out from the dot.
I want to be able to rotate the line around 360 degrees. Like the hand of a clock. In my own hopeless efforts, the line changes sizes etc.

I would love a clever snippet that followed something like this syntax:

/drawline2 @window <color> <x y of dot> <Length of line > <angle of line>

Remember the line should appear to be the same the length at all angles, so it can stay in the confines of a circle, like a hand of a clock. If anyone has such code, please post it. Or point to the Maths stuff I need to learn to do it, thanks.


Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
x = cos(angle) * r
y = sin(angle) * r
EDIT: or was it other way around... dunno...

/help $sin
/help $cos

and look with google for trigonometry or smthng like that to get some explanations

Last edited by theRat; 28/04/03 07:29 PM.

Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
By the definition of a circle, it wouldn't appear to be the same length, it IS the same length. All points on the circle are equidistant from the center. If that property doesn't hold true, then you aren't working with a circle.


Link Copied to Clipboard