Question: Create a timeline animation that shows a line with one end at the center of a 300*300 stage and the other end that follows around

Create a timeline animation that shows a line with one end at the center of a 300*300 stage and the other end that follows around a circle whose radius is half the size of the square stage like the second hand of a clock. Create an array of 100 such lines using a for loop ,and then use this array as the frames for a KeyFrame object.hint : the center of the stage is NOT(0,0) but if it was ,the location of the end of the line would (300*cos(a),300*sin(a)) where a is an angle in radians .For each of the 100 locations (step 0 through 99) this angle will be step*2*pi/100.Of course the center of the stage is really (150,150) so you will have to account for that.set the frame duration so that the line does a complete rotation once per second.

Step by Step Solution

3.37 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javaawtColor import javaawtGraphics import javaawtGraphics2D import javaawteventActionEvent i... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!