Is there has a algorithm to find the longgest axis in a model

is there has a algorithm to find the longgest axis in a model
and find the input point and target point of the longest axis in the model?