Question: what are the java docs for each public class? struggling on them public class Vector3D { private double private double private double public Vector3D(double x,

public class Vector3D { private double private double private double public Vector3D(double x, double y, double z) { this.x = X this.y = Y; this.Z = z; 6 public double getX() { return x; public double getY() { return y; public double get2() { return z; 19 0 32 52 33 public double getMagnitude() { return Math.sqrt(x * y y + 2 + 2); C} I 56 37 38 39 @Override public String toString() { return "{" + x + "," 40 public Vector3D normalize() { double mag = getMagnitude(); if (Double.comparece, mag) -- - B) { throw new IllegalstateException("Error, Vector cannot be normalized); } else { return new Vector3D( * * / magyy / mag, 22/mag); } } public Vector30 add (Vector3D vector3D) { else { return new Vector3D( x: / mag, yy / mag, 12 / mag); public Vector30 add (Vector3D vector3D) { double xx = x + vector3D.getX(); double yy = y + vector3D.getY(); double zz = 2 + vector3D.get2(); return new Vector3D(xx,yy, zz); public Vector3D multiply(double factor) { double xx = X * factor; double y = y* factor; double zz = 2 * factor; return new Vector3D(xx,yy, z2); e public double dotProduct(Vector3D vector3D) { double xx - x * vector3D.getX(); double y yvector3D.getY(); double zz = 2 * vector3D.getzo; return XX YY + 22 e public double angleBetween(Vector3D vector3D) { double den = getMagnitude() + vector3D.getHachitude(); if (Double.compare(a, den) == 0) { throw new IllegalStateException("Error, vector cannot be normalized"); } else { return Math.acos(dotProduct (vector30) / den)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
