Spray angle

sc_2023 <- sc_2023 |> 
  mutate(location_x = 2.5 * (hc_x - 125.42),
         location_y = 2.5 * (198.27 - hc_y),
         spray_angle = atan(location_x / location_y) * 180 / pi
  )
sc_hr <- sc_2023 |> filter(events == "home_run")

ggplot(sc_hr, aes(spray_angle, hit_distance_sc)) +
  geom_point(alpha = 0.25)
## Warning: Removed 35 rows containing missing values or values outside the scale range
## (`geom_point()`).