Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
4th Edition
ISBN: 9780134787961
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 14.1, Problem 14.9CP
Explanation of Solution
setRotate method:
- The method “setRotate” rotates a node about its center.
- Any node present in scene graph can be rotated using the method.
- The parameter “ANGLE” is passed to it as an argument.
- It denotes rotation angle in degrees.
Example:
The example for “setRotate” method is given below:
Rectangle bx = new Rectangle(X, Y, W, H);
bx.setRotate(ANGLE);
Here, “bx” denotes an object of “Rectangle” class. The values “X” and “Y” denotes coordinates of rectangle and “W” and “H” denotes width as well as height of rectangle respectively...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
How do you rotate a 2D object without using trigonometry?
Do a Magic 8 ball in Python GUI
How to draw a yellow moving
star in c ++ computer graphics
Chapter 14 Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Ch. 14.1 - Prob. 14.1CPCh. 14.1 - Prob. 14.2CPCh. 14.1 - Prob. 14.3CPCh. 14.1 - Prob. 14.4CPCh. 14.1 - In what package is the Color class?Ch. 14.1 - Prob. 14.6CPCh. 14.1 - Prob. 14.7CPCh. 14.1 - Prob. 14.8CPCh. 14.1 - Prob. 14.9CPCh. 14.1 - Prob. 14.10CP
Ch. 14.1 - Prob. 14.11CPCh. 14.1 - Prob. 14.12CPCh. 14.2 - Prob. 14.13CPCh. 14.2 - Prob. 14.14CPCh. 14.2 - Prob. 14.15CPCh. 14.2 - Prob. 14.16CPCh. 14.2 - Prob. 14.17CPCh. 14.2 - Prob. 14.18CPCh. 14.2 - Prob. 14.19CPCh. 14.2 - Prob. 14.20CPCh. 14.2 - Prob. 14.21CPCh. 14.3 - Prob. 14.22CPCh. 14.3 - Prob. 14.23CPCh. 14.3 - Prob. 14.24CPCh. 14.3 - Prob. 14.25CPCh. 14.3 - Prob. 14.26CPCh. 14.3 - Prob. 14.27CPCh. 14.3 - Prob. 14.28CPCh. 14.3 - Prob. 14.29CPCh. 14.3 - Prob. 14.30CPCh. 14.4 - What two classes do you use to play an audio file?Ch. 14.4 - Refer to your answer to Checkpoint 14.31. In what...Ch. 14.4 - Prob. 14.33CPCh. 14.4 - Prob. 14.34CPCh. 14.5 - What three classes do you use to play a video...Ch. 14.5 - Refer to your answer to Checkpoint 14.35. In what...Ch. 14.5 - Prob. 14.37CPCh. 14.6 - Prob. 14.38CPCh. 14.6 - Prob. 14.39CPCh. 14.6 - What type of event happens when the user presses...Ch. 14.6 - What KeyEvent method can you call to determine...Ch. 14.6 - Refer to your answer for Checkpoint 14.41. What...Ch. 14 - Line, Circle, and Rectangle are subclasses of...Ch. 14 - Prob. 2MCCh. 14 - Prob. 3MCCh. 14 - Prob. 4MCCh. 14 - Prob. 5MCCh. 14 - Prob. 6MCCh. 14 - Prob. 7MCCh. 14 - Prob. 8MCCh. 14 - This interpolator causes an animation to start...Ch. 14 - You use these two classes to play an audio file....Ch. 14 - Prob. 11TFCh. 14 - Prob. 12TFCh. 14 - True or False: If an ellipses X-radius and...Ch. 14 - Prob. 14TFCh. 14 - Prob. 15TFCh. 14 - Write a statement that instantiates the Line...Ch. 14 - Write a statement that instantiates the Circle...Ch. 14 - Prob. 3AWCh. 14 - Write code that does the following: Instantiates...Ch. 14 - Prob. 5AWCh. 14 - Write a statement that instantiates the Text...Ch. 14 - Prob. 7AWCh. 14 - Assume myBox is a Rectangle object. Write the code...Ch. 14 - Write code that creates a Circle, with a radius of...Ch. 14 - Prob. 10AWCh. 14 - Prob. 11AWCh. 14 - Prob. 1SACh. 14 - Prob. 2SACh. 14 - Prob. 3SACh. 14 - Prob. 4SACh. 14 - Prob. 5SACh. 14 - Prob. 6SACh. 14 - What RotateTransition class method do you use to...Ch. 14 - Prob. 8SACh. 14 - Prob. 9SACh. 14 - Prob. 10SACh. 14 - Prob. 11SACh. 14 - Prob. 1PCCh. 14 - Tree Age Counting the growth rings of a tree is a...Ch. 14 - Hollywood Star Make your own star on the Hollywood...Ch. 14 - Prob. 4PCCh. 14 - Solar System Use the Circle class to draw each of...Ch. 14 - Prob. 6PCCh. 14 - Prob. 7PCCh. 14 - Prob. 8PCCh. 14 - Coin Toss Write a program that simulates the...Ch. 14 - Lunar Lander The books online resources...Ch. 14 - Change for a Dollar Game The books online...Ch. 14 - Rock, Paper, Scissors Game Write a program that...
Knowledge Booster
Similar questions
- The correct choice to draw lines from point (160,120) to point (160,250) is 40,250 160,250 260,250 260,180 260,120 40,120 160,120 Polyline Line Polygon ORTHOarrow_forwardBackground and formula: Ellipse has two types of axis - Major Axis and Minor Axis. The longest chord of the ellipse is the major axis. The perpendicular chord to the major axis is the minor axis, which bisects the major axis at the center as shown in Figure 1. Ellipse is different with circle which has only one radius. There is no simple formula to calculate the exact or accurate value of perimeter of an ellipse. Therefore, we use approximation formulas to calculate the approximate value of an ellipse's perimeter. One of the approximation methods is called Ramanujan Formula as follows: p zn[3(a+b) – Г(За + b) (а + зь)| where a is the semi major axis and b is the semi minor axis of the ellipse, respectively, as shown in Figure 1. be major axis Figure 1. Ellipse The problem An input file, data.txt has the following information: data.txt 4 3 8 4 3 2 7 Write a complete C++ program that read the values of major axis and minor axis from input file, data.txt; and then compute its perimeter…arrow_forwardBackground and formula: Ellipse has two types of axis - Major Axis and Minor Axis. The longest chord of the ellipse is the major axis. The perpendicular chord to the major axis is the minor axis, which bisects the major axis at the center as shown in Figure 1. Ellipse is different with circle which has only one radius. There is no simple formula to calculate the exact or accurate value of perimeter of an ellipse. Therefore, we use approximation formulas to calculate the approximate value of an ellipse's perimeter. One of the approximation methods is called Ramanujan Formula as follows: p z n[3(a + b) – (3a + b)(a + 3b)] where a is the semi major axis and b is the semi minor axis of the ellipse, respectively, as shown in Figure 1. b (major axis data.txt 4 8 5 7 Write a complete C+ program that read the values of major axis and minor axis from input file, data.txt; and then compute its perimeter using the Ramanujan Formula. The first column in the input file is the major axis, while the…arrow_forward
- Moon effect. Some people believe that the Moon controls their activities. If the Moon moves from being directly on the opposite side of Earth from you to being directly overhead, by what percentage does (a) the Moon's gravitational pull on you increase and (b) your weight (as measured on a scale) decrease? Assume that the Earth-Moon (center-to-center) distance is 3.82 x 10° m, Earth's radius is 6.37 x 106 m, Moon's mass is 7.36 x 1022 kg, and Earth's mass is 5.98 x 1024 kg. (a) Number 6.89 Units percent (b) Number i 6.8713e-4 Units percentarrow_forwardLesson: Application of Computer Graphics What is the difference of soft shadows and hard shadows? How do you implement soft shadows in ray tracing? Simply explain.arrow_forwardWhat phrase describes the whole amount of time it takes to rotate and find something?arrow_forward
- When we want the perpendicular projection on a specific object in the first angle, the arrow the pointer in the figure represents the direction of the projection Front view Top view Side viewarrow_forwardNewton Method - Flowchart please draw a flow chart for a general Newton Method with 5 iterations.arrow_forwardANSWER NUMBER 9 ONLYarrow_forward
- Python(turtle) Use turtle graphics to draw a house! A house, should have: walls roof door 2-4 windows Sample house below Pseudo Code Function draw_window(x, y): (x, y passing location) Draw window without inner grid Draw inner grid of window Main Draw top and right side wall of house Draw bottom and door of house Draw left wall and roof Draw_window(x, y) – first location Draw_window(x, y) – second location Draw_window(x, y) – third location Provide the REPL weblink in the URL entry and submit the assignment.arrow_forwardVideo Graphics Array (VGA) mode is used to show images on a screen. Where do you get your information?arrow_forwarddraw lines that show 03 digit, you need to use Midpoint Line Drawing Algorithm. Computer graphics. please describe with codesarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr