Um, maximum range is a parabolic arc
the bullet is fired at 45*, then for advanced use, you calculate the friction (drag) for the air density and the specif gravitation acceleration (drop) and where it intersects Y axis, va-la...
BTW a .22 can fire ~2 miles