The red line shows the route from the Ahwahnee Hills Park to Yosemite's south entrance. It's a detour of a bit over 5 miles (8 km) from Oakhurst, which you'll pass through if you're entering Yosemite from the south on Highway 41. To get to the Ahwahnee Park, turn left from 41 onto Highway 49; the intersection is the southernmost stoplight in Oakhurst (see a street view of the intersection; turn left here). It's 22 miles (35 km) overall from the park to the south entrance.
The orange line shows the route to Yosemite's Arch Rock (Highway 140) entrance. This is a considerable detour - it's more than 50 miles (80 km) from the park to the entrance. If your plan is to approach Yosemite from the south on 41 and then turn onto Highway 49 to reach the park via the 140 entrance, though, you'll pass right past the park on your way, with a detour of just over 0 miles (0 km). It's 20 miles (32 km) from the park north to Mariposa, and then another 35 miles (55 km) to Yosemite.
The park itself is adjacent to Highway 49 at the north end of Ahwahnee (Ahwahnee the city, not Ahwahnee the very famous hotel in Yosemite Valley). Here's a street view of the main entrance and another of the dirt parking lot at the south end; the pedestrian gate at the sound end is the only permitted option for getting into the park on Mondays and Tuesdays, when the main entrance is closed. The main entrance is offset a bit and not easily spotted by southbound traffic; if you're approaching from the north, you'll likely pass it and have to turn around somewhere in Ahwahnee.