I am making a little game and I am now working on a "radar". Now to do this I need to find two points based off how much a point has rotated around a center point.
A
is going to rotate around C
.
As A
rotates around C
, B
& D
will move along with A
and stay in the same "positions" based off of where A
is.
So for example, if A
rotates around C
90 degrees B
& D
would then move and be in this position
But I am not very good at trig, so I don't really know the math I would need in order to find B
& D
based off how much A
has rotated around C
.
How do i find B
& D
based off of how much A
has rotated around C
?
I would image the final math would look somewhat similar to this:
float * returnB(float * APoint, float * CPoint)
{
float B_Out[2];
//calculate where B is based off A & C
B_Out[0] = B_X;
B_Out[1] = B_Y;
return B_Out;
}
float B[2];
B[0] = returnB(A,C)[0];
B[1] = returnB(A,C)[1];
float * returnD(float * APoint, float * CPoint)
{
float D_Out[2];
//calculate where D is based off A & C
D_Out[0] = D_X;
D_Out[1] = D_Y;
return D_Out;
}
float D[2];
D[0] = returnD(A,C)[0];
D[1] = returnD(A,C)[1];