Forum

> > CS2D > Scripts > Angle counting
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Angle counting

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Angle counting

Danikah
User Off Offline

Zitieren
CAUTION! BAD ENGLISH AHEAD!

I just wanna know that how can I count what angle do I need to turn my image if I want it to face to a specific position.

So: Example:

x . . . . . . . .
. . . . . . . . y

And I want a little code that counts what angle do the x image need to turn to face to the y coordinate.

alt Re: Angle counting

archmage
User Off Offline

Zitieren
Use this:
1
math.atan2(y2-y, x2-x) * 180.0/math.pi

Just replace x and y with you images position and replace x2 and y2 with the position you want the image to face.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht