// When you copy this code into your project // you will have to place a package statement here. // Include a Javadoc comment here. public class Intersection { // Define the coordinates of the center of a circle. // These are also the coordinates of the point at // which the two lines segments will intersect. // You can change these values---make them anything // that you like. private static double cx = 2.0; private static double cy = 3.0; // Define the radius of the circle. // This value determines the length of // the line segments. // You can give this variable any positive // value that you like. private static double radius = 1.0; // Define the slope of a line segment that // passes through the center of the circle. // Change this value if you like. private static double angle01 = Math.PI/4; // Define the coordinates of the endpoints of that // line segment on the circumference of the circle. private static double x0 = cx + radius * Math.cos( angle01 ); private static double y0 = cy + radius * Math.sin( angle01 ); private static double x1 = cx + radius * Math.cos( angle01 + Math.PI ); private static double y1 = cy + radius * Math.sin( angle01 + Math.PI ); // Define the slope of a second line segment that // passes through the center of the same circle. // Change this value if you like. // Make sure that this value differs from the // value of angle01. private static double angle23 = Math.PI/6; // Define the coordinates of the endpoints of this // second line segment on the circumference of the same circle. private static double x2 = cx + radius * Math.cos( angle23 ); private static double y2 = cy + radius * Math.sin( angle23 ); private static double x3 = cx + radius * Math.cos( angle23 + Math.PI ); private static double y3 = cy + radius * Math.sin( angle23 + Math.PI ); // Define your own method(s) here. Include Javadoc comments // immediately before the start of each method. public static void main( String [] args ) { // This statement is here just so that you can // be sure that you are compiling and executing // the right program at the start. // Do not include this statement in the finished // project. System.out.println( "Hello from Examination 1." ); // Compute the value of s. // Compute the value of t. // Compute and print the values of x(s), y(s). // x(s) and y(s) are the functions that produce // coordinates of points on the line segment that // is bounded by (x0, y0) and (x1, y1). // Compute and print the values of x(t), y(t). // x(t) and y(t) are the functions that produce // coordinates of points on the line segment that // is bounded by (x2, y2) and (x3, y3). // x(t) is a different function than x(s)!! // y(t) is a different function than y(s)!! } // main( String [] ) } // Intersection