public class Turn { public static void main(String[] args) { // Different initial values will be used for testing int x = 1; int y = 1; // Turn the arrow by 90 degrees System.out.print("x:", y + 90);...


public class Turn
{
public static void main(String[] args)
{
// Different initial values will be used for testing
int x = 1;

int y = 1;


// Turn the arrow by 90 degrees


System.out.print("x:", y + 90);
System.out.println(x);
System.out.print("y: ", x - 1 );
System.out.println(y);


// Turn the arrow again


System.out.print("x:", y - 1);
System.out.println(x);
System.out.print("y: ",x + 90);
System.out.println(y);
}
}


..• 5. Consider an arrow starting at the origin and ending at the point (x, y). Turning the arrow by 90 degrees changes the coordinates as follows:<br>Xafter = Ybefore<br>Yafter = -Xbefore<br>(*pefore» Y'before)<br>002<br>'after> Yafrer)<br>Complete this program that computes and prints two turns of a given arrow. Develop the equations that replace the variables x and y with their rotated values. Copy them and paste<br>them for another turn.<br>codecheck-bjlo-1e-02_02<br>Turn.java<br>

Extracted text: ..• 5. Consider an arrow starting at the origin and ending at the point (x, y). Turning the arrow by 90 degrees changes the coordinates as follows: Xafter = Ybefore Yafter = -Xbefore (*pefore» Y'before) 002 'after> Yafrer) Complete this program that computes and prints two turns of a given arrow. Develop the equations that replace the variables x and y with their rotated values. Copy them and paste them for another turn. codecheck-bjlo-1e-02_02 Turn.java

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here