user9139: If you want to determine whether a player is in check I think you would:
1.1) determine every legal move of the opposition;
1.2.) determine whether such a move threatens our king (i.e. could 'take' the king)
To determine 1.1) above you need to:
2.1.) consider every active piece of the opposition and its possible moves;
2.2.) see whether that move conforms to a valid type of move (i.e. moves likes a castle,knight etc)
2.3.) confirm that such a move doesn't place the opposition in check (otherwise it's not a valid move)
Yet 2.3 requires us to go back to 1.1-in order to determine whether the opposition's move is not check (and thus valid) we need to consider all the possible moves of our side (the side which we wanted to determine if it was in check originally).
It seems that this leads to some horrible circular dependency. Obviously, it doesn't as otherwise chess wouldn't be a game!
Where am I going wrong?

user10380: "If you want to determine whether a player is in check", then consider each opposing unit in turn. If it observes the turn player's king, the turn player is in check. Andrew's answer goes some way to explaining how one might do this, but missed the subtlety that an enemy line-piece's line of attack on the turn player's king might be obstructed by another unit, in which case the said enemy line-piece does not give check.
This task is similar to, but not the same as, generating all legal moves for the turn player's opponent. But unlike the latter task, the former does not entail deciding whether any king is in check. This algorithm is therefore not "circular" (i.e. does not entail an infinte recursion), and implements the definition of check, which is therefore not circular either.

user25131: You say that your definition seems to be wrong because it is circular. You are right.
The part that makes it circular is step 2.3, which is required to evaluate “legal” in step 1.1. This is where you went wrong. The moves that would capture the king must be legal except for possibly putting the opponent in check. In other words, a piece pinned to the opponent’s king can still give check to the first player.
See the links in limits’s answer.

You worded step 1.2 as (emphasis added):

determine whether such a move threatens our king (i.e. could 'take' the king)

This is an incorrect use of the word “threatens”. For example, in the game below, 1...e5 threatens 2...Qh4#. In this sense, it threatens the king, but is not itself a capture of the king.
[FEN ""]
1.f3 e5 2.g4 Qh4


user12: Generally speaking, the most "expensive" part of chess programs is generating all legal moves from a certain position.  Anything that can be done to avoid that is usually done because it speeds everything up significantly.  
In order to find out whether a move is check or not, you can do several relatively simple checks (all of these are simple addition in most board coordinate systems).

See if the king is a rook's move away from enemy rooks or queens
See if the king is a bishop's move away from enemy bishops or queens
See if the king is a knight's move away from enemy knights
See if the king is diagonally adjacent to enemy pawns

By changing the thinking to start with the king's position, it makes some of these determinations far more simple.  Another note is that most programs have an explicit variable set for the king's position because it's used quite frequently and there is always a single king for each side.  
As a note, this same routine is called to see if a piece is pinned when generating legal moves.  After the move is "made", if the friendly king is attacked then the move was illegal.  

user7500: A move can be illegal because the opponent could "take" the king. This "taking the king" move does not need to be "legal". See Can a piece pinned to my king put the opponent's king in check? and Is the king actually in check if the attacking piece cannot be moved?

9139: <p>If you want to determine whether a player is in check I think you would:</p>

<p>1.1) determine every legal move of the opposition;</p>

<p>1.2.) determine whether such a move threatens our king (i.e. could 'take' the king)</p>

<p>To determine 1.1) above you need to:</p>

<p>2.1.) consider every active piece of the opposition and its possible moves;</p>

<p>2.2.) see whether that move conforms to a valid type of move (i.e. moves likes a castle,knight etc)</p>

<p>2.3.) confirm that such a move doesn't place the opposition in check (otherwise it's not a valid move)</p>

<p>Yet 2.3 requires us to go back to 1.1-in order to determine whether the opposition's move is not check (and thus valid) we need to consider all the possible moves of our side (the side which we wanted to determine if it was in check originally).</p>

<p>It seems that this leads to some horrible circular dependency. Obviously, it doesn't as otherwise chess wouldn't be a game!</p>

<p>Where am I going wrong?</p>
 10380: <p>&quot;If you want to determine whether a player is in check&quot;, then consider each opposing unit in turn. If it observes the turn player's king, the turn player is in check. <a href="https://chess.stackexchange.com/a/13277">Andrew's answer</a> goes some way to explaining how one might do this, but missed the subtlety that an enemy line-piece's line of attack on the turn player's king might be obstructed by another unit, in which case the said enemy line-piece does not give check.</p>
<p>This task is similar to, but not the same as, generating all legal moves for the turn player's opponent. But unlike the latter task, the former does not entail deciding whether any king is in check. This algorithm is therefore not &quot;circular&quot; (i.e. does not entail an infinte recursion), and implements the definition of check, which is therefore not circular either.</p>
 25131: <p>You say that your definition seems to be wrong because it is circular. You are right.</p>
<p>The part that makes it circular is step 2.3, which is required to evaluate “legal” in step 1.1. This is where you went wrong. The moves that would capture the king must be legal <em>except for possibly putting the opponent in check</em>. In other words, a piece pinned to the opponent’s king can still give check to the first player.</p>
<p>See the links in <a href="https://chess.stackexchange.com/a/13274/25131">limits’s answer</a>.</p>
<hr />
<p>You worded step 1.2 as (emphasis added):</p>
<blockquote>
<p>determine whether such a move <strong>threatens</strong> our king (i.e. could 'take' the king)</p>
</blockquote>
<p>This is an incorrect use of the word “threatens”. For example, in the game below, 1...e5 <em>threatens</em> 2...Qh4#. In this sense, it <em>threatens</em> the king, but is not itself a capture of the king.</p>
<pre><code>[FEN &quot;&quot;]
1.f3 e5 2.g4 Qh4
</code></pre>
 12: <p>Generally speaking, the most "expensive" part of chess programs is generating all legal moves from a certain position.  Anything that can be done to avoid that is usually done because it speeds everything up significantly.  </p>

<p>In order to find out whether a move is check or not, you can do several relatively simple checks (all of these are simple addition in most board coordinate systems).</p>

<ol>
<li>See if the king is a rook's move away from enemy rooks or queens</li>
<li>See if the king is a bishop's move away from enemy bishops or queens</li>
<li>See if the king is a knight's move away from enemy knights</li>
<li>See if the king is diagonally adjacent to enemy pawns</li>
</ol>

<p>By changing the thinking to start with the king's position, it makes some of these determinations far more simple.  Another note is that most programs have an explicit variable set for the king's position because it's used quite frequently and there is always a single king for each side.  </p>

<p>As a note, this same routine is called to see if a piece is pinned when generating legal moves.  After the move is "made", if the friendly king is attacked then the move was illegal.  </p>
 7500: <p>A move can be illegal because the opponent could "take" the king. This "taking the king" move does not need to be "legal". See <a href="https://chess.stackexchange.com/questions/2348/can-a-piece-pinned-to-my-king-put-the-opponents-king-in-check?rq=1">Can a piece pinned to my king put the opponent&#39;s king in check?</a> and <a href="https://chess.stackexchange.com/questions/3966/is-the-king-actually-in-check-if-the-attacking-piece-cannot-be-moved?rq=1">Is the king actually in check if the attacking piece cannot be moved?</a></p>
