954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

programing dynamic image

i have to create image that is to mimic a single clock hand rotating within a square area,before the hand rotate the following must be selected by the user:the color,width of the hand,the speed of the rotation,and direction.pliz someone here help me come up wiyh codes and variables 4 this

Goitseone
Newbie Poster
3 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Its basic Trigonomentry to find the location of the point as long as you know 3 things.
1. the origin - (x, y)
2. the angle - t
3. the radius - r

and your trying to find the co-ordinates (a, b) of the cirumference of a circle to locate where the end of your "hand" will go.

using the formulas:

a = x + (r * cos(t))
b = y + (r * sin(t))

where r is the length of your "hand"

you can find your (a, b) co-ordinates.

You can then use the (a, b) co ordinates to position your "hand"

'making the lines x1 and y1 co-ords at the origin
line1.x1 = x
line1.y1 = y

'moving part of the line
line1.x2 = a
line1.y2 = b
OblibSystems
Junior Poster in Training
65 posts since Aug 2011
Reputation Points: 22
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: