Scripts in 3DCoat include classes for working with 3D graphics.
Please, check them out. Their names are pretty self-explanatory, if you're familiar with 3D modeling.
Examples of those classes are inside the classes - just click on the links!
You may play with math on a simple lines: look for classes Line3 and Lines3.