Reference no: EM13163848
This programming project was given to us. We are expected to sumbit two files: Vector3D.java and Vector3DTester.java
I understand what needs to be done conceptually, but am unsure where to begin. Any help is much appreciated.
Write a client class to test your implementation of the Vector3D class that
you implemented. Name the package in which this class is defined (project
name) vector3dapp.
1. Using an object of the Scanner class, your program will prompt the
user for the ?rst, second and third components of three 3-d vectors,
say v1, v2, and v3. Your program will then create three 3-d vectors
using these values.
2. Your program will then display v1, v2, and v3.
3. Your program will compute and display v1 + v2.
4. Your program will compute and display (v2 + v3) v1.
5. Your program will compute and display v1 × (v2 ? v3).
6. Your program will compute and display (v2 ? v3) × v1.
7. Your program will compute and display |v1 × v2| and |v2| |v1|.
8. Your program will compute and display v1×v2
|v1×v2|
.
9. Your program will compute and display v1 × (v2 + v3).
10. Your program will compute and display (v1 × v2) + (v1 × v3)
A typical program interaction would be:
Sample Run:
Enter the components of the first 3-d vector-> 1.1 2.1 3.1
Enter the components of the second 3-d vector-> 2.2 3.2 1.2
Enter the components of the third 3-d vector-> 3.3 1.3 2.3
v1 = <1.100000,2.100000,3.100000>
v2 = <2.200000,3.200000,1.200000>
v3 = <3.300000,1.300000,2.300000>
v1 + v2 = <3.300000,5.300000,4.300000>
(v2 + v3) * v1 = 26.350000
v1 x (v2 - v3) = <-8.200000,-2.200000,4.400000>
(v2 - v3) x v1 = <8.200000,2.200000,-4.400000>
|v1 x v2| = 9.285473 and |v2||v1| = 15.861891
(v1 x v2) / (|v1 x v2|) = <-0.796944,0.592323,-0.118465>
v1 x (v2 + v3) = <-6.600000,13.200000,-6.600000>
(v1 x v2) + (v1 x v3) = <-6.600000,13.200000,-6.600000>