Implement a data type Vector3D for three-dimensional vectors that has the same API as Vector, except that the constructor takes three double values as arguments. Also, add a cross-product method: the cross-product of two vectors is another vector, defined by the equation
a × b = c |a| |b| sinθ
where c is the unit normal vector perpendicular to both a and b, and θ is the angle between a and b. In Cartesian coordinates, the following equation defines the cross-product:
(a0, a1, a2) × (b0, b1, b2) = (a1b2 – a2b0 – a0b2, a0b1 – a1b0)
The cross-product arises in the definition of torque, angular momentum, and vector operator curl. Also, |a × b| is the area of the parallelogram with sides a and b.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.