Clark and Park implementation code
This is the first time I have to implement a PMDC motor control system.
There are 3-phase sine currents need to be converted into d-q components using Clark and Park.
I don't have the motor to test yet, so with the DAC I created three 120° phase-shifted sine waves that I need to convert into d-q components. This is an example of the code I wrote:

My questions are:
1) Is this code sufficient for conversion?
2) Is there an implementable library that performs these calculations? I found only this, but it is not clear to me what it can do
Can anyone, in general, give me some more information on how to proceed?
