converted few more comp. geometry functions to C++