Yes that math looks correct, and should work for the accel/cruise/decel and accel/decel speed profiles that Accelstepper approximates. There may be some misalignment due to accelstepper’s approximations of v=at and p=1/2at^2 but it is small.
This thread discusses the multi-axis motion planning through calculating accel/speed constants versus the Bresenham algorithm that CNCs use: