Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Program {
- public static void main(String[] args) {
- Vector v1 = new Vector(0, 10);
- System.out.println("Vector v1: " + v1);
- System.out.printf("Magnitude v1: %.2f\n", v1.magnitude());
- Vector v2 = new Vector(3, 2);
- v1.add(v2);
- System.out.println("Vector v1 + vector v2: " + v1);
- System.out.printf("Magnitude v1 + v2: %.2f\n", v1.magnitude());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement