java arrow from edge of screen to face object else where in map
===

I have an arrow on the edge of the screen in my Java game that's supposed to point to an object else where on the map but it just keeps going round the screen and fails to point at the object, any ideas why?

Here's my code:

    float angle = (float)Math.toDegrees(Math.atan2(currentInteractive.getY()-player.pos[1], currentInteractive.getX()-player.pos[0]));
    arrow.setRotation(angle);

    float magnitude;
    float abs_cos_angle = (float) Math.abs(Math.cos(angle));
    float abs_sin_angle = (float) Math.abs(Math.sin(angle));
    if (Main.DISPLAY_WIDTH/2*abs_sin_angle <= Main.DISPLAY_HEIGHT/2*abs_cos_angle)
    {
        magnitude = Main.DISPLAY_WIDTH/2/abs_cos_angle;
    }
    else
    {
        magnitude = Main.DISPLAY_HEIGHT/2/abs_sin_angle;
    }
    float ax = (float) (camera.viewPort.getCenterX() + Math.cos(angle)*magnitude);
    float ay = (float) (camera.viewPort.getCenterY() + Math.sin(angle)*magnitude);

    arrow.draw(ax, ay, Color.green);