negative angle value android
<p>I am trying to include the projectile motion for my game app.When the user touches the imageview   it calculates the initial angle based on the motion of the imageview.But in logcat I am seeing that these angle values are negative .Can anyone explain why is this so .I want the use r to just set the value of angle between 0 and 90 degree.</p>

<p>Find below my code for calculating angle:-</p>

<pre><code>float dy = motion.getY()-mImage.getPivotY();
float dx = motion.getX()-mImage.getPivotX();

double r = Math.atan2(dy, dx);

int angle = (int)Math.toDegrees(r);
</code></pre>

<p>where motion is of type MotionEvent.</p>
