HAL_COMP(iclarke);

#define SQRT3 1.732050808

HAL_PIN(a) = 0;
HAL_PIN(b) = 0;

HAL_PIN(u);
HAL_PIN(v);
HAL_PIN(w);


RT(
	float ua = PIN(a);
	float ub = PIN(b);

	float u = ua; // inverse clarke
	float v = - ua / 2.0 + ub / 2.0 * SQRT3;
	float w = - ua / 2.0 - ub / 2.0 * SQRT3;
   
   PIN(u) = u+1000;
   PIN(v) = v+1000;
   PIN(w) = w+1000;
);

ENDCOMP;