1. how can i make sure that the precision of the coordinate '(0 0 0) is respecting the precision factor in rule?
Please explain exactly what you mean ..
what is "
respecting the precision factor in rule" ?
2. advise [how to] make this function more stable and efficient
Where is it not stable ??
Where is it not efficient ??
one tip :
Don't use the end of statement comment.
It is really painful to look at and just clutters up what could be nice clean code.
added:
It is a pity that you didn't describe this functionality in the first post.
Using polar seems to be the best solution.
You could experiment with the sample from
ElpanovEvgeniy but I don't think you will find a more efficient solution than the one you have.