Tesla Interview Question

build a cpp class to solve a geometry problem