## 2 A Rapid Output Matching Optimization Method with Dual-Objective Orientation
### Verification of the Impedance Point Within the OID  
The OID is essentially a closed polygon formed by connecting a series of discrete impedance points successively. To quickly determine whether the complex impedance \(Z_{\text{omn}}(f_{i})\) resides inside the predefined OID, the ray-casting algorithm is utilized, as it is well suited to both convex and concave polygons and offers high computational efficiency. It works by emitting a ray from the point of interest and counting the intersections with the polygon boundaries, applying the parity rule to distinguish between interior and exterior positions. Consider the OID as a non-self-intersecting closed polygon with \(V\) vertices on the real (X)-imaginary (Y) plane, with the vertex coordinates \(\{(x_{1},\,y_{1}),\,(x_{2},\,y_{2}),\,\ldots,\,(x_{V},\,y_{V})\}\), where \(x_{1}=x_{V}\) and \(y_{1}=y_{V}\) to ensure closure. The point under investigation, \(Z_{\text{omn}}(f_{i})\), has the coordinates \((x_{\text{omn}},\,y_{\text{omn}})\). To facilitate computation, the ray is emitted horizontally towards the positive X-axis. The specific identification steps are as follows:  
Step 1: Traverse all edges of the polygon  
Each edge of the polygon is traversed in sequence to check for intersection with the horizontal ray. In particular, edges whose endpoints have the same imaginary value (horizontal edges) are disregarded to prevent miscounting caused by coinciding with the ray.  
Step 2: Check whether the range of the edge's imaginary part covers \(y_{\text{omn}}\)  
An edge is considered for intersection only when \(y_{\text{omn}}\) of the test point lies within the range of the edge's imaginary part; that is, min \((y_{\text{a}},\,y_{\text{a+1}})\leq y_{\text{omn}}\leq\) max \((y_{\text{a}},\,y_{\text{a+1}})\). If the condition is not fulfilled, skip this edge.  
Step 3: Compute the X-coordinate where the horizontal ray intersects with the edge  
The parametric equation for the edge can be expressed as Equation (8). Substituting the ray formula \(y=y_{\text{omn}}\) yields the parameter \(t\), as shown in Equation (9). If \(t\)\(\in\)\((0,1)\), the intersection exists on the edge, with the X-coordinate given by \(x_{\text{cr}}=x_{\text{a}}+t(x_{\text{a+1}}-x_{\text{a}})\). Only when \(x_{\text{cr}}\geq x_{\text{omn}}\) is this intersection counted, confirming it is situated to the right of the test point.  
\[\left\{\begin{array}{l}x=x_{\text{a}}+t(x_{\text{a+1}}-x_{\text{a}})\\ y=y_{\text{a}}+t(y_{\text{a+1}}-y_{\text{a}})\end{array}\right. \tag{8}\]  
\[t=\frac{y_{\text{omn}}-y_{\text{a}}}{y_{\text{a+1}}-y_{\text{a}}} \tag{9}\]  
Step 4: Count the total number of intersections  
After iterating through all polygon edges, the sum of valid intersections is computed, and its parity is examined. An odd total indicates that \(Z_{\text{omn}}(f_{i})\) is located inside the OID; otherwise, it is outside the domain.  
Figure 2: IMD3 load-pull contours and the determination of S-OID.  
In cases where \(Z_{\rm omm}(f_{\rm i})\) lies exactly on an edge or a vertex of the polygon, the determination mechanism classifies it as being inside the OID. Notably, if the ray passes through a polygon vertex, the intersection is counted for only one of the adjacent edges to avoid duplication.