Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In regular java Problem: Rotate Point About The Origin (40 points+10) Write a program to compute the new coordinates of a 2D point rotated about

In regular java image text in transcribed
image text in transcribed
Problem: Rotate Point About The Origin (40 points+10) Write a program to compute the new coordinates of a 2D point rotated about the origin. Input Validation: None for numerical input (assume user will enter floating point or integral values). Rotation direction is indicated by'+ for counter-clockwise or for clockwise. Requirements Prompt the user to enter x- and y- co-ordinates. Prompt the user to enter angle or rotation in degrees. Prompt to use to enter direction of rotation. Calculate and display the new co-ordinates after rotation. ."bonus" Compute and display the quadrant before and after the rotation HINT: Pay attention to the angle measurement units assumed by the Java trigonometry functions Submit: RotatePoint.java Formulas and other info: For point (x, y) rotated counter-clockwise about the origin by angle 9 the new co-ordinates (x, y) are given by * for clockwise rotation, use the same formula but multiply by (-1). . You should test your program against an online calculator such as this one O Type here to search for clockwise rotation, use the same formula but multiply 8 by (-1). . You should test your program against an online calculator such as this one. Sample Runs: java RotatePoint Enter x- and y-coordinate: 2.455 0 Enter angle of rotation in degrees: 90 Enter '+' for counter-clockwise or'-' for clockwise rotation:+ New coordinates are (O.0, 2.46) eron@DESKTOP-OH04PIH MINGW64/Documents/Teachin s java RotatePoint Enter x- and y-coordinate: 8.1 3.6 Enter angle of rotation in degrees: 45 4 Enter '+'for counter-clockwise or'-' for clockwise rotation: Invalid input: * with bonus: s java RotatePoint Enter x- and y-coordinate: 1.3247 4.999 Enter angle of rotation in degrees: 87 Enter '+' for counter-clockwise or'for clockwise rotation: From quadrant I to quadrant IV new coordinates are (5.06, -1.06) Problem: Print Diagonal Line (15 points) Write a program that produces the output below S java Diagonal Type here to search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

Explain how real option valuation (ROV) is applied.

Answered: 1 week ago