To Find the Origin of a Point using a Function in Java