Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of priustroller_2 by
transforms.cpp
00001 #include "includes.h" 00002 #include "transforms.h" 00003 #include "fastmath.h" 00004 00005 void Transforms::Clarke(float a, float b, float *alpha, float *beta) { 00006 *alpha = a; 00007 *beta = (a + 2.0f * b)/sqrt(3.0f); 00008 } 00009 00010 void Transforms::InverseClarke(float alpha, float beta, float *a, float *b) { 00011 *a = alpha; 00012 *b = -0.5 * alpha + sqrt(3.0f) / 2.0f * beta; 00013 } 00014 00015 void Transforms::Parke(float beta, float alpha, float theta, float *d, float *q) { 00016 float cos = FastCos(theta); 00017 float sin = FastSin(theta); 00018 *d = alpha * cos + beta * sin; 00019 *q = -alpha * sin + beta * cos; 00020 } 00021 00022 void Transforms::InverseParke(float d, float q, float theta, float *alpha, float *beta) { 00023 float cos = FastCos(theta); 00024 float sin = FastSin(theta); 00025 *alpha = cos * d - sin * q; 00026 *beta = sin * d + cos * q; 00027 }
Generated on Tue Jul 12 2022 18:31:15 by
1.7.2
