Not too sure on how to approach this
// vectorCalculus.java
import java.util.*;
public class vectorCalculus {
public static final String divideLine = "\n-----------------------------------------------";
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Vector<Double> lineVector = new Vector<Double>();
Vector<Double> planeVector = new Vector<Double>();
System.out.print("Type in the x-coordinate of points in the line: ");
double xCoordinateLine = sc.nextDouble();
System.out.print("Type in the y-coordinate of points in the line: ");
double yCoordinateLine = sc.nextDouble();
System.out.print("Type in the z-coordinate of points in the line: ");
double zCoordinateLine = sc.nextDouble();
System.out.printf("A line is given: (%f, %f, %f)", xCoordinateLine, yCoordinateLine, zCoordinateLine);
System.out.println(divideLine);
System.out.print("Type in the x-coordinate of vector for line: ");
lineVector.add(sc.nextDouble());
System.out.print("Type in the y-coordinate of vector for line: ");
lineVector.add(sc.nextDouble());
System.out.print("Type in the z-coordinate of vector for line: ");
lineVector.add(sc.nextDouble());
System.out.printf("The line vector, d, is given: [%f, %f, %f]", lineVector.get(0), lineVector.get(1),
lineVector.get(2));
System.out.println(divideLine);
System.out.print("Type in the A coefficient value of the plane pi: ");
planeVector.add(sc.nextDouble());
System.out.print("Type in the B coefficient value of the plane pi: ");
planeVector.add(sc.nextDouble());
System.out.print("Type in the C coefficient value of the plane pi: ");
planeVector.add(sc.nextDouble());
System.out.print("Type in the D coefficient value of the plane pi: ");
planeVector.add(sc.nextDouble());
System.out.printf("A plane vector, n, is given: [%f, %f, %f]\n", planeVector.get(0), planeVector.get(1),
planeVector.get(2));
System.out.printf("Plane equation: %fx + %fy + %fz + %f", planeVector.get(0), planeVector.get(1),
planeVector.get(2), planeVector.get(3));
System.out.println(divideLine);
// Parametric equations of line pass thru plane
// formula set for dotProduct, planeEquation, and normOfPlane
double dotProduct = (lineVector.get(0) * planeVector.get(0)) + (lineVector.get(1) * planeVector.get(1))
+ (lineVector.get(2) * planeVector.get(2));
double planeEquation = ((planeVector.get(0) * xCoordinateLine) + (planeVector.get(1) * yCoordinateLine)
+ (planeVector.get(2) * zCoordinateLine) + (planeVector.get(3)));
double normOfPlane = (Math.sqrt(
Math.pow(planeVector.get(0), 2) + Math.pow(planeVector.get(1), 2) + Math.pow(planeVector.get(2), 2)));
if (dotProduct != 0) {
System.out.println("The dot product is not equal to 0. Therefore the line, l, intersects to plane pi.");
System.out.println("The dot product: " + dotProduct);
System.out.println("Creating a line parametric equations for D1.");
System.out.println("For D1,\nx = " + xCoordinateLine + " + " + lineVector.get(0) + "t" + "\ny = "
+ yCoordinateLine + " + " + lineVector.get(1) + "t" + "\nz = " + zCoordinateLine + " + "
+ lineVector.get(2) + "t");
System.out.print("Type in the value t for D1: ");
double valueT1 = sc.nextDouble();
double d1x = xCoordinateLine + lineVector.get(0) * valueT1;
double d1y = yCoordinateLine + lineVector.get(1) * valueT1;
double d1z = zCoordinateLine + lineVector.get(2) * valueT1;
System.out.println("For D1,\nx = " + d1x + "\ny = " + d1y + "\nz = " + d1z);
System.out.println(divideLine);
System.out.println("Creating a line parametric equations for D2.");
System.out.println("For D2,\nx = " + xCoordinateLine + " + " + lineVector.get(0) + "t" + "\ny = "
+ yCoordinateLine + " + " + lineVector.get(1) + "t" + "\nz = " + zCoordinateLine + " + "
+ lineVector.get(2) + "t");
System.out.print("Type in the value t for D2: ");
double valueT2 = sc.nextDouble();
double d2x = xCoordinateLine + lineVector.get(0) * valueT2;
double d2y = yCoordinateLine + lineVector.get(1) * valueT2;
double d2z = zCoordinateLine + lineVector.get(2) * valueT2;
System.out.println("For D2,\nx = " + d2x + "\ny = " + d2y + "\nz = " + d2z);
System.out.println(divideLine);
System.out.println("For P1,\nx = " + d1x + " + " + planeVector.get(0) + "t" + "\ny = " + d1y + " + "
+ planeVector.get(1) + "t" + "\nz = " + d1z + " + " + planeVector.get(2) + "t\n");
System.out.println("For P2,\nx = " + d2x + " + " + planeVector.get(0) + "t" + "\ny = " + d2y + " + "
+ planeVector.get(1) + "t" + "\nz = " + d2z + " + " + planeVector.get(2) + "t");
System.out.println(divideLine);
// Find t
double e1t = (-planeVector.get(3) - planeVector.get(0) * d1x - planeVector.get(1) * d1y
- planeVector.get(2) * d1z)
/ ((planeVector.get(0) * planeVector.get(0)) + (planeVector.get(1) * planeVector.get(1))
+ (planeVector.get(2) * planeVector.get(2)));
System.out.println("t = " + e1t);
double e1x = d1x + planeVector.get(0) * e1t;
double e1y = d1y + planeVector.get(1) * e1t;
double e1z = d1z + planeVector.get(2) * e1t;
System.out.println("E1 = (" + e1x + ", " + e1y + ", " + e1z + ")");
// Find t
double e2t = (-planeVector.get(3) - planeVector.get(0) * d2x - planeVector.get(1) * d2y
- planeVector.get(2) * d2z)
/ (planeVector.get(0) * planeVector.get(0) + planeVector.get(1) * planeVector.get(1)
+ planeVector.get(2) * planeVector.get(2));
System.out.println("t = " + e2t);
double e2x = d2x + planeVector.get(0) * e2t;
double e2y = d2y + planeVector.get(1) * e2t;
double e2z = d2z + planeVector.get(2) * e2t;
System.out.println("E2 = (" + e2x + ", " + e2y + ", " + e2z + ")");
double projectionX = e2x - e1x;
double projectionY = e2y - e1y;
double projectionZ = e2z - e1z;
System.out.println("The projection of line onto plane pi = J: [x, y, z] = [" + e1x + ", " + e1y + ", " + e1z
+ "] + [" + projectionX + ", " + projectionY + ", " + projectionZ + "]t");
}
if (dotProduct == 0 && planeEquation == 0) {
System.out.println(
"The dot product is equal to 0, \nand the initial point of the line, l, satisfies the plane pi equation.");
System.out.println("Therefore the line, l, is in the plane.");
System.out.println("Plane equation: Ax + By + Cz + D = 0");
System.out.println("Plane equation: " + planeVector.get(0) + "x + " + planeVector.get(1) + "y + "
+ planeVector.get(2) + "z + " + planeVector.get(3) + " = 0");
System.out.println("Plane equation: " + planeVector.get(0) + "(" + xCoordinateLine + ") + "
+ planeVector.get(1) + "(" + yCoordinateLine + ") + " + planeVector.get(2) + "(" + zCoordinateLine
+ ") + " + planeVector.get(3) + " = " + planeEquation);
System.out.println(divideLine);
}
if (dotProduct == 0 && planeEquation != 0) {
System.out.println(
"The dot product is equal to 0,\nand the initial point of the line, l, does not satisfy the plane pi equation.");
System.out.println("Therefore the line, l, is parallel to the plane pi.");
System.out.println("Plane equation: Ax + By + Cz + D = 0");
System.out.println("Plane equation: " + planeVector.get(0) + "x + " + planeVector.get(1) + "y + "
+ planeVector.get(2) + "z + " + planeVector.get(3) + " = 0");
System.out.println("Plane equation: " + planeVector.get(0) + "(" + xCoordinateLine + ") + "
+ planeVector.get(1) + "(" + yCoordinateLine + ") + " + planeVector.get(2) + "(" + zCoordinateLine
+ ") + " + planeVector.get(3) + " != 0" + " (" + planeEquation + ")");
System.out.println(divideLine);
System.out.println("Creating a line parametric equations for D1.");
System.out.println("For D1,\nx = " + xCoordinateLine + " + " + lineVector.get(0) + "t" + "\ny = "
+ yCoordinateLine + " + " + lineVector.get(1) + "t" + "\nz = " + zCoordinateLine + " + "
+ lineVector.get(2) + "t");
System.out.print("Type in the value t for D1: ");
double valueT1 = sc.nextDouble();
double d1x = xCoordinateLine + lineVector.get(0) * valueT1;
double d1y = yCoordinateLine + lineVector.get(1) * valueT1;
double d1z = zCoordinateLine + lineVector.get(2) * valueT1;
System.out.println("For D1,\nx = " + d1x + "\ny = " + d1y + "\nz = " + d1z);
System.out.println(divideLine);
System.out.println("Creating a line parametric equations for D2.");
System.out.println("For D2,\nx = " + xCoordinateLine + " + " + lineVector.get(0) + "t" + "\ny = "
+ yCoordinateLine + " + " + lineVector.get(1) + "t" + "\nz = " + zCoordinateLine + " + "
+ lineVector.get(2) + "t");
System.out.print("Type in the value t for D2: ");
double valueT2 = sc.nextDouble();
double d2x = xCoordinateLine + lineVector.get(0) * valueT2;
double d2y = yCoordinateLine + lineVector.get(1) * valueT2;
double d2z = zCoordinateLine + lineVector.get(2) * valueT2;
System.out.println("For D2,\nx = " + d2x + "\ny = " + d2y + "\nz = " + d2z);
System.out.println(divideLine);
System.out.println("For P1,\nx = " + d1x + " + " + planeVector.get(0) + "t" + "\ny = " + d1y + " + "
+ planeVector.get(1) + "t" + "\nz = " + d1z + " + " + planeVector.get(2) + "t\n");
System.out.println("For P2,\nx = " + d2x + " + " + planeVector.get(0) + "t" + "\ny = " + d2y + " + "
+ planeVector.get(1) + "t" + "\nz = " + d2z + " + " + planeVector.get(2) + "t");
System.out.println(divideLine);
// Find t
double e1t = (-planeVector.get(3) - planeVector.get(0) * d1x - planeVector.get(1) * d1y
- planeVector.get(2) * d1z)
/ ((planeVector.get(0) * planeVector.get(0)) + (planeVector.get(1) * planeVector.get(1))
+ (planeVector.get(2) * planeVector.get(2)));
System.out.println("t = " + e1t);
double e1x = d1x + planeVector.get(0) * e1t;
double e1y = d1y + planeVector.get(1) * e1t;
double e1z = d1z + planeVector.get(2) * e1t;
System.out.println("E1 = (" + e1x + ", " + e1y + ", " + e1z + ")");
// Find t
double e2t = (-planeVector.get(3) - planeVector.get(0) * d2x - planeVector.get(1) * d2y
- planeVector.get(2) * d2z)
/ (planeVector.get(0) * planeVector.get(0) + planeVector.get(1) * planeVector.get(1)
+ planeVector.get(2) * planeVector.get(2));
System.out.println("t = " + e2t);
double e2x = d2x + planeVector.get(0) * e2t;
double e2y = d2y + planeVector.get(1) * e2t;
double e2z = d2z + planeVector.get(2) * e2t;
System.out.println("E2 = (" + e2x + ", " + e2y + ", " + e2z + ")");
double projectionX = e2x - e1x;
double projectionY = e2y - e1y;
double projectionZ = e2z - e1z;
System.out.println("The projection of line onto plane pi = J: [x, y, z] = [" + e1x + ", " + e1y + ", " + e1z
+ "] + [" + projectionX + ", " + projectionY + ", " + projectionZ + "]t");
// distance
double distance = Math.abs(((planeVector.get(0) * d1x) + (planeVector.get(1) * d1y)
+ (planeVector.get(2) * d1z) + planeVector.get(3))) / normOfPlane;
System.out.println("The distance between line and pi = " + distance);
}
}
}
================================================================================
sample output
Not too sure on how to approach this General directions. (1) You may use a computer...
Find a description of the solution set of each system of linear equations below by car rying out the following steps. (i) Use Gaussian elimination to find the solution set S as you did in Chapter 1. (ii) Find a point Q and a set of points B:- (Pi. P2... so that S-Q+Span IB. (iii) show that B is a basis for L :--Span B. what is the dimension of the space L? (iv) Describe S as looking like either...
Problem 1
WITRUUNIMLJ. Muues 14 and 15 Geometric applications and some 3D plotting You should strategically employ Symbolab/Wolfram for evaluating and checking symbolic things. Octave for ALL 3D plotting, please - this is one of our "demonstrate you can use Octave (MATLAB)" | assignments. Don't forget to include both scripts and plots. Problem 1: Consider the function f(x, y) = 2x? In(y)-3x*y at the point (a,b,f(a,b)) = (1,1, S (1,1)). (a) Find f(x,y), S.(a,b), S (x,y), ,(a,b), and f(a,b). (b)...
please answer question 4-7
Prove the arithmetic properties of the Cross Product 1. 2. a. Line L1 is parallel to the vector u Si+j, line L2 is parallel to the vector u-3i +4j and both lines pass through point P(-1,-2). Determine the parametric equations for line L1 and Lz b. Given line L:x(t)-2t+8,y(t)-10-3t. Does L and Ls has common 3. a. Find the equation of the plane A that pass through point P(3,-2,0) with b. Given A2 be the plane...
GENERAL INSTRUCTIONS All requirements specified on page 64-67 of the course packet “2.5 Programming Assignment Submission Requirements” and “2.6 Flow Chart Symbols” should be followed. Plan the programs on paper before you attempt to write any programs (it will take less time to complete the assignment overall). Electronic version of your programs (the .m files you create) must be uploaded to Canvas. Attach multiple files to one submission. All files must be received by the beginning of...
(1 point) A stone is thrown from a rooftop at time t 0 seconds. Its position at time t (the components are measured in meters) is given by r()-бі-50+ (24.5-49:2) k. The origin is at the base of the bulding, which is standing on flat ground. Distance is measured in meters. The vector i points east,j points north, and k points up. (a) How high is the rooftop? meters. (b) When does the stone hit the ground? seconds (c) Where...
Math 32-_ Multivariable Calculus HW 3 (1) Consider the two straight lines L1 : (2-t, 3 + 2t,-t) and L2 : <t,-2 + t, 7-20 a) Verify that L1 and L2 intersect, and find their point of intersection. (b) Find the equation of the plane containing L1 and L2 (2) Consider the set of all points (a, y, z) satisfying the equation 2-y2+220. Find their intersection 0 and 2-0. Use that information to sketch a with the planes y =-3,-2,-1,0,...
o1 points 1 Previous Answors LarPCalc8 10.2.012. 1. Describe in words how a plane could intersect with the double-napped cone shown to form the conic section. (Select all that apply.) Hyperbola e The plane intersects both the top and bottom of a double-napped cone. The plane is perpendicular to the axis of the cone. e The plane intersects only the top or bottom half of a double-napped cone. The plane is parallel to the axis of the cone. The plane...
3. The projection theorem we learned in class focuses on projecting onto subspaces. In general, W, the set you are projecting onto, does not actually have to be subspace of V. (a) Let a and b be nonzero vectors in an inner product space (V,(,)) with a not a scalar multiple of b. Define W-(a+ bt where t E R} which is a subset of V. Show that W is not a subspace of V. (b) Given u in V,...
Implement the histogram function to complete the desired program. You must use dynamically allocated arrays for this purpose. For your initial implementation, use ordered insertion to keep the words in order and ordered sequential search when looking for words. Note that the array utility functions from the lecture notes are available to you as art of the provided code. Although we are counting words in this program, the general pattern of counting occurrences of things is a common analysis step...
A GRAPHING CALCULATOR IS REQUIRED FOR THIS QUESTION. You are permitted to use your calculator to solve an equation, find the derivative of a function at a point, or calculate the value of a definite integral. However, you must clearly indicate the setup of your question, namely the equation, function, or integral you are using. If you use other built-in features or programs, you must show the mathematical steps necessary to produce your results. Your work must be expressed in...