hi!
this is a simple math question: i need to turn a figure (in this example just a line) arround the center of the coordinate system by a certain angle
but this is not working as it should. i already drew a few sheets of paper with my thoughts and they all ended up in the garbage. i'd appreceate it, if someone would help me:)
thanks so far :)
this is a simple math question: i need to turn a figure (in this example just a line) arround the center of the coordinate system by a certain angle
Graphics 640, 480, 32, 2 SetBuffer BackBuffer() While Not KeyHit(1) ;the center of the coordinate system Plot 300, 200 ;these variables are the coordinates of the line, ;hich needs to be turned arround the center of ;the coordinate system x1 = -50 y1 = 80 x2 = 50 y1 = 80 ;(they can be ANYTHING besides this) ;the calculations, which are wrong! timer = timer + 5 p1x = x1 * Cos(timer) p1y = y1 * Sin(timer) p2x = x2 * Cos(timer) p2y = y1 * Sin(timer) ;just draw it Line 300 + p1x, 200 + p1y, 300 + p2x, 200 + p2y Flip Cls Wend End
but this is not working as it should. i already drew a few sheets of paper with my thoughts and they all ended up in the garbage. i'd appreceate it, if someone would help me:)
thanks so far :)