[IMP] product_spine: added the maths to calculate the spine and a test to the maths.