A helper for returning the main axis for vector, given this direction.
vector
double mainAxis(Vector2 vector) { return vector[mainAxisVectorIndex]; }