The structure of 12C and 16O in a cluster model with varying hinge angle