Create these four constructors java following the comments a
Create these four constructors (java) following the comments above each of them.
// Instantiates a new zero vector.
public Vector() {
//TODO
}
// Instantiates a new vector with specified delta values.
public Vector(double deltx, double delty) {
// TODO
}
// Instantiates a new unit vector with specified angle.
// parameter angle is the angle to construct
public Vector(double angle) { // in radians
// TODO
}
// Instantiates a new vector between two points.
public Vector(Point p, Point q) {
// TODO
}
Solution
Hey,I have written code in JAVA given below.Hope,it will help you.As,you didn\'t mentioned about the type of data referred by \"Point\" ;I took it as int and did it.Any further queries or doubts please feel free to contact us.We will love to help you
Code:
Output:
The zero vector 0.0
The two vectors 2.0 3.0
The vector angle 2.3 in radians
The points are 1.0 2.0
