Let $n$ be a positive integer. Given are points $P_1,\ P_2,\ \cdots,\ P_{4n}$ of which any three points are not collinear. For $i=1,\ 2,\ \cdots,\ 4n$, rotating half-line $P_iP_{i-1}$ clockwise in $90^\circ$ about the pivot  $P_i$ gives half-line $P_iP_{i+1}.$ Find the maximum value of the number of the pairs of $(i,\ j)$ such that line segments $P_iP_{i+1}$ and $P_jP_{j+1}$ intersect at except endpoints. 
Note that : $P_0=P_{4n},\ P_{4n+1}=P_1$ and $1\leq i<j\leq 4n.$
1. **Understanding the Problem:**
   We are given \(4n\) points \(P_1, P_2, \ldots, P_{4n}\) such that no three points are collinear. For each point \(P_i\), the half-line \(P_iP_{i-1}\) is rotated \(90^\circ\) clockwise about \(P_i\) to form the half-line \(P_iP_{i+1}\). We need to find the maximum number of pairs \((i, j)\) such that the line segments \(P_iP_{i+1}\) and \(P_jP_{j+1}\) intersect at a point other than their endpoints.

2. **Analyzing the Rotation:**
   Since each half-line \(P_iP_{i-1}\) is rotated \(90^\circ\) clockwise to form \(P_iP_{i+1}\), the points \(P_1, P_2, \ldots, P_{4n}\) form a closed polygon where each segment \(P_iP_{i+1}\) is perpendicular to the previous segment \(P_{i-1}P_i\).

3. **Intersection of Segments:**
   For two segments \(P_iP_{i+1}\) and \(P_jP_{j+1}\) to intersect, they must be non-adjacent and not share any endpoints. This means \(i\) and \(j\) must be such that \(i \neq j\) and \(|i - j| \neq 1\).

4. **Counting Intersections:**
   To maximize the number of intersecting pairs, we need to consider the combinatorial nature of the problem. Each segment \(P_iP_{i+1}\) can potentially intersect with any other segment \(P_jP_{j+1}\) where \(j \neq i\) and \(|i - j| \neq 1\).

5. **Combinatorial Calculation:**
   The total number of ways to choose 2 segments out of \(4n\) is given by \(\binom{4n}{2}\). However, we need to exclude the pairs where the segments are adjacent or share endpoints. There are \(4n\) such pairs (one for each segment).

   Therefore, the number of valid intersecting pairs is:
   \[
   \binom{4n}{2} - 4n
   \]

6. **Simplifying the Expression:**
   \[
   \binom{4n}{2} = \frac{4n(4n-1)}{2} = 2n(4n-1)
   \]
   \[
   \text{Number of intersecting pairs} = 2n(4n-1) - 4n = 8n^2 - 2n - 4n = 8n^2 - 6n
   \]

The final answer is \(\boxed{8n^2 - 6n}\).