...
/Solution Review: Visualize a Vector and Its Components
Solution Review: Visualize a Vector and Its Components
Have a look at the solution to the 'Visualize a Vector and its Components' challenge.
We'll cover the following...
We'll cover the following...
Rubric criteria
Solution
Rubric-wise explanation
Point 1:
Look at line 11. We declare the header of the getXComp method: public Double getXComp(Integer magnitude, Double direction).
Point 2, 3, 4:
We calculate the x component at line 13. Notice that we first convert the angle (direction) into radians using the Math.toRadians() function. Then, we apply the Math.cos() function on the angle and ...