Give an implementation of minus() for Vector solely in terms of the other Vector methods, such as direction() and magnitude().
Answer:
The advantage of such implementations is that they limit the amount of detailed code to check; the disadvantage is that they can be inefficient. In this case, plus() and times() both create new Vector objects, so copying the code for plus() and replacing the minus sign with a plus sign is probably a better implementation.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here