Hey all!
I found something interesting i would like to do, but i cant seem to figure out how to do it.
In vc++ you can draw lines that have x1,x2,y1,y2. All i want to do is to rotate them with a timer or a button. I do not need code, all i need is some directions on how are you supposed to alter the coordinates.
Pasted it on to wrong tab when i was going to answer something similar to Angelhoof, and then internet got disconnected before I could delete it before you could ask what.
Forget it.
Anyways, award892, do some maths to go with graphics.h
So you cant? I think it is possible, i just cant think of the function. Since we have coordinates of x and y from both points, why wouldn't it be possible?
Because by definition you rotate by an angle.
If you don't have any angle, the term 'rotation' doesn't make any sense.
Do this experiment:
Grab two sheets of paper, a larger one and a smaller one.
Put the small one over the bigger one.
Dig a hole in the center of the small one with a pencil.
Draw a line on the small sheet in a way that it goes out of the boundary and draws a mark on the big one
Rotate the small sheet around the hole
Mark the new position of the line.
You got an angle http://i26.tinypic.com/rqylwh.png
The angle is not a property of the shape, it's just the amount of rotation.
Google a bit for 'rotation' and come back when you know something about it, you clearly have no idea of what a rotation is
Zhuge, thanks for that post.
NOW I UNDERSTAND WHAT YOU MEANT BAZZY!
I am such a freaking idiot to not understand such a simple thing....
Its late, so im gonna try it out 2morrow and see how it goes.
x' = x cos ( theta ) - y sin ( theta )
does this mean
xNew = xOld * cos(theta) - yOld * sin (theta) ?
Or did i understand it wrongly? couse if theta = 1, i get some stupid random coordinates on the shape