Search found 3 matches

by palcodev
Tue Mar 01, 2016 2:13 pm
Forum: General
Topic: Trigonometry Problem
Replies: 8
Views: 4428

Re: Trigonometry Problem

norm(a cross b) = |a||b|sinC a dot b = |a||b|cosC C angle between a and b Edit: Also AFAIK C is the small angle thus between 0 and pi and atan2 might give results between 0 and pi I am too lazy to verify it though Edit2: ax*by-bx*ay is different from norm(a x b) as it preserves sign thus atan2 give...
by palcodev
Tue Mar 01, 2016 2:08 pm
Forum: General
Topic: Trigonometry Problem
Replies: 8
Views: 4428

Re: Trigonometry Problem

Thank you a lot, I got the solution just like some of you said. Got two vectors: the PadVector and the ShipVector (wich I had only the angle so I used [cos(ShipAngle), sin(ShipAngle)] as a vector because it's length is 1. cos(a) = (Padvector . ShipVector) / (PadVectorLength * ShipVectorLength) so: a...
by palcodev
Mon Feb 29, 2016 4:21 pm
Forum: General
Topic: Trigonometry Problem
Replies: 8
Views: 4428

Trigonometry Problem

Well, first of all, I'm not English fluent so sorry for any misspell or something like that. I'm actually Brazilian. I'm developing a game (for android) in which a space ship can turn and shot in any direction. My first solution for doing this was a movement pad at the left and turning buttons at th...