Java(Android): Rotating an Image on Canvas

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CodeNoob117
    New Member
    • Jan 2013
    • 19

    Java(Android): Rotating an Image on Canvas

    How would I rotate an image, in place, on canvas? I have an image at location (x, y) facing North (represented by: static double NORTH = 0.0) and want to turn the image to face the new location when a motion press occurs at (x2, y2). Given the starting direction, x and y coordinates, how could I achieve this? I have seen algorithms using Math.atan(); however, I have been unsuccessful in implementing these. Any advice and ideas is appreciated!

    Thanks,
    CodeNoob117
Working...