The trajectory of the compact torus (CT) within a tokamak discharge is crucial to fueling. In this study, we developed a penetration model with a vacuum magnetic field region to accurately determine CT trajectories in tokamak discharges. This model was used to calculate the trajectory and penetration parameters of CT injections by applying both perpendicular and tangential injection schemes in both HL-2A and ITER tokamaks. For perpendicular injection along the tokamak's major radius direction from the outboard, CTs with the same injection parameters exhibited an 0.08 reduction in relative penetration depth when injected into HL-2A and a 0.13 reduction when injected into ITER geometry when considering the vacuum magnetic field region compared with cases where this region was not considered. In addition, we proposed an optimization method for determining the CT's initial injection velocity to accurately calculate the initial injection velocity of CTs for central fueling in tokamaks. Furthermore, this paper discusses schemes for the tangential injection of CT into tokamak discharges. The optimal injection angle and CT magnetic moment direction for injection into both HL-2A and ITER were determined through numerical simulations. Finally, the kinetic energy loss occurring when the CT penetrated the vacuum magnetic field region in ITER was reduced by ΔEk=975.08J by optimizing the injection angle for the CT injected into ITER. These results provided valuable insights for optimizing injection angles in fusion experiments. Our model closely represents actual experimental scenarios and can assist the design of CT parameters.