Video acquisition and analysis workflow.

(a) Experimental setup used to record each crab’s behavior. (b) Extraction of two-dimensional position coordinates from video frames.

Method for determining movement directions of each crab.

For each movement bout, movement direction was defined as the angle between the previous body axis (from tail to head) and the displacement vector of the body’s center (referred to as the midpoint). Displacement was measured when the midpoint reached the reference circle. These values across all movement bouts were then used to calculate the Forward–Sideways Index (FSI).

Distribution of Forward–Sideways Index (FSI) values among crab species exhibiting forward and sideways locomotion.

Orange bars represent species classified as forward movers, and blue bars represent species classified as sideways movers.

Representative circular histograms of movement directions in crabs.

(a) Forward movement in Ranina ranina (FSI = 0.89). (b) Sideways movement in Geothelphusa dehaani (FSI = -0.70). The 0°-180° axis denotes the crab’s body axis before movement, with bars indicating the frequency of movement direction.

Ancestral state reconstruction of locomotion in crabs under the all-rates-different (ARD) model.

Red circles at the tips indicate forward locomotion, whereas blue circles indicate sideways locomotion. Pie charts at internal nodes and along branches represent the posterior probabilities of each locomotor state, estimated from 500 stochastic character maps. The x-axis shows geological time, scaled in millions of years before present (mya).