From 'hexapodV3 28-april-2012-Backup.rar'. Oud/ is the 2011 code it was based on.
24 lines
372 B
C++
24 lines
372 B
C++
// Rotation.cpp
|
|
|
|
#include "Rotation.h"
|
|
|
|
void Rotation::getData(int ix[6], int iy[6], int iz[6])
|
|
{
|
|
for (int i=0; i<6; i++)
|
|
{
|
|
x[i] = ix[i];
|
|
y[i] = iy[i];
|
|
z[i] = iz[i];
|
|
}
|
|
}
|
|
|
|
int NewX, NewY;
|
|
void rotate (int x, int y, int angel)
|
|
{
|
|
NewY = x * sin(radians(angel)) + y * cos(radians(angel));
|
|
NewX = x * cos(radians(angel)) - y * sin(radians(angel));
|
|
}
|
|
|
|
|
|
|