# help with trigonometry

Get help using Construct 2

### » Sun Aug 19, 2012 8:45 am

Hi Guys,

Not too hot on trigonometry wondered if someone could help?

My object is the green arrow (it's facing right)
How do I detect when the mouse cursor is the darker part of the circle?

Thanks!
B
3
Posts: 3
Reputation: 531

### » Sun Aug 19, 2012 10:39 am

The great thing about C2 is that it does all the trigonometry for you.
My approach would be:

Demo

capx
B
84
S
32
G
24
Posts: 121
Reputation: 15,566

### » Sun Aug 19, 2012 11:41 am

Hi Kastas

Thanks for the quick reply but I'm afraid you've taken my question too literally. Yes, that works, but in reality the circle doesn't exist.

I really do need the trigonometry...

B
3
Posts: 3
Reputation: 531

### » Sun Aug 19, 2012 11:56 am

The circle is an illusion Neo.

Or perhaps you should explain in more details what you're wanting to do, expecting to do with such a detection and so we could provide more efficient help.
New to Construct ? Where to start

Please attach a capx to any help request or bug report !
Moderator
B
304
S
123
G
99
Posts: 7,358
Reputation: 73,460

### » Sun Aug 19, 2012 12:03 pm

B
173
S
50
G
195
Posts: 8,578
Reputation: 121,892

### » Sun Aug 19, 2012 12:32 pm

Couldnt between x y do the trick without the circle?
B
5
S
1
Posts: 10
Reputation: 722

### » Sun Aug 19, 2012 12:49 pm

Newt, great thank you! That does the job nicely :)
B
3
Posts: 3
Reputation: 531

### » Sun Aug 19, 2012 3:49 pm

[QUOTE=newt] Again, C2 does the math for you.

https://dl.dropbox.com/u/666516/moveatmouseangle.capx[/QUOTE]

C2 and @newt at their best. Crazy simple. I feel like an ...
B
84
S
32
G
24
Posts: 121
Reputation: 15,566

### » Sun Aug 19, 2012 5:55 pm

My turret behavior has exactly that. If you don't mind using third party plugins, it can be a great way to achieve that without thinking too much or complicating your code, and it can be added to multiple instances.

check it out
B
36
S
8
G
8
Posts: 532
Reputation: 6,903