completed trig d2. Untested
implemented trigD3.

Not tested.