Calculating and Drawing Firing Arcs

In my current project (2D), the player's ship has a firing arc. I'd like to show the user the arcs, so I am drawing lines. The problem I am having is making the arc turn with the player as they rotate.

I do this twice, to get the end point for each line:

    Vector2 ln = new Vector2(0, 0);
    ln.x = Mathf.Cos(45f) * range + transform.position.x;
    ln.y = Mathf.Sin(45f) * range + transform.position.y;

This seems to work, except I'm not sure how to use the players Z axis rotation value so the drawn arc will turn with them.

As I understand your question this should do it:

ln.x = Mathf.Cos(45f+ln.z) * range + transform.position.x; ln.y = Mathf.Sin(45f+ln.z) * range + transform.position.y;

My first issue is that Mathf.Cos does not take degrees. Second, I needed to use transform.rotation.eulerAngles.z to account for the players rotation.