I just want to know how you\'d print in the format thats wanted for this problem
ID: 3679112 • Letter: I
Question
I just want to know how you'd print in the format thats wanted for this problem.
Recall that the angular momentum vector can be calculated via H_ = I_ omega where H_ is the angular momentum vector, I_ is the moment of inertia tensor (a 3D moment of inertia - for our purposes, can be treated like a matrix), and omega is the angular velocity vector. Consider a system with moment of inertia matrix I_ = and angular velocity vector omega = 1.3 b_1 + 0 b_2 - 2.3b_3 rad/s. Calculate the angular momentum vector, and print it as a row vector to the Command Window with a label, units and the unit vectors (do not worry about the finding a way to type subscripts or the ^ symbol over the unit vector - your result should look something like H = X b1 + Y b2 + z b3 (N-m-s), where X, Y and z should be replaced by the actual values of each component of the vector). Use a selection structure to test if H_, omega and the b_2 unit vector all lie within the same geometric plane (i.e. are co-planar). Process to determine this: If they all lie within the same plane, print a statement to the Command Window to that effect; otherwise, if they do not all lie within the same plane, print a statement to the Command Window' to that effect. You might recall that three vectors are co-planar if any one of them is orthogonal to (at a right angle to) a vector created by the cross product of the other two (it is your choice how you want to approach it). You might further recall that if two vectors are orthogonal, their dot product is 0. Piece these facts together.Explanation / Answer
We have to print each 3 vector elements on a single row / line. Then we have to move to the next line.
For printing items on the same line, we have to use System.out.print() method. For moving to the next line / row we have to use System.out.println() method. Then again we need to carry on printing the next vector elements using the System.out.print() method.