IsFacing and IsBehind calculations
<p>I'm looking for better way to calculate if one object facing another or one is behind another. So far I've been able to create this but it seems to not working 100% correctly :(</p>

<p>I also think it should be in radians rather then degrees.</p>

<pre><code>public static float GetAngle(float x1, float y1, float x2, float y2)
{
    float xDiff = x2 - x1;
    float yDiff = y2 - y1;
    var angle = RadianToDegree((float)Math.Atan2(yDiff, xDiff));

    if (angle &lt; 0)
        return 360 + angle;

        return angle;
    }

public static bool IsFacing(Point obj, float rotationAngle, Point target, float arcDegree = 180)
{
    var angleBetweenPoints = GetAngle(obj, target);

    return rotationAngle &gt;= angleBetweenPoints - arcDegree / 2 &amp;&amp; rotationAngle &lt;= angleBetweenPoints + arcDegree / 2;
}

public static bool IsBehind(Point obj, float rotationAngle, Point target, float arcDegree = 180)
{
    var angleBetweenPoints = GetAngle(obj, target);
    var backViewAngle = rotationAngle &gt; 180 ? rotationAngle - 180 : 180 - rotationAngle;
    return backViewAngle &gt;= angleBetweenPoints - arcDegree / 2 &amp;&amp; backViewAngle &lt;= angleBetweenPoints + arcDegree / 2;
}
</code></pre>
