First you need to get the mouse's position. Then you need to know the
position vector of the sprite. Then you need to rotate the sprite
until its axis aligned with the where the mouse is. You can use the
sin function to orient the position vector of the sprite in a way that its
axis aligned with the mouses position.
As you can see you will also have to calculate the line from x = 0
to x = MAX where the line needs to intersect the sprite position.
Then you will have to do the same for the mouse point. And lastly
you need to rotate the mouse until its line is very similar to that of the
Another way is to determine the angle of a line from the center of the screen to your mouse, then rotate your image that much. Don't forget to check the mouse position constantly, either using a timer (like every x seconds) or every time the mouse moves.
Actually you can also use Pythagorean. Make a right trials with the end point from the center of the sprite and the mouse clicked point, then
all you have to do is rotate the sprite by using the sin function until the
y component of the right triangle goes to 0.
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...