// Your job is to fill in all the missing function bodies. Be sure to add your
// name to this file, and rename it!
/**
* Vector is an object representing a mathematical 3-dimensional
* vector. Objects like this are useful when doing 3D graphics, or physics
* calculations.
*
* @author Adam Smith
* @version 1.0
*/
public class Vector {
private double x, y, z;
/**
* Create a new Vector
, from its x, y, and z values.
* @since 1.0
*/
public Vector(double x, double y, double z) {
}
/**
* Add a second Vector
to this
.
* @param other the other Vector
to add
* @return the resulting Vector
* @since 1.0
*/
public Vector add(Vector other) {
return null;
}
/**
* Subtract a second Vector
from this
.
* @param other the other Vector
to subtract
* @return the resulting Vector
* @since 1.0
*/
public Vector subtract(Vector other) {
return null;
}
/**
* Multiply this
by a scalar value.
* @param scalar the value by which to multiply
* @return the resulting Vector
* @since 1.0
*/
public Vector multiply(double scalar) {
return null;
}
/**
* Calculate the cross product of this
with another
* Vector
.
* @param other the other Vector
* @return the resulting Vector
* @since 1.0
*/
public Vector calcCrossProduct(Vector other) {
return null;
}
/**
* Calculate the dot product of this
with another
* Vector
.
* @param other the other Vector
* @return the resulting dot product
* @since 1.0
*/
public double calcDotProduct(Vector other) {
return Double.NaN;
}
/**
* Calculate the length of this
.
* @return the length
* @since 1.0
*/
public double calcLength() {
return Double.NaN;
}
/**
* Create a new Vector
with the same proportions as
* this
, but with a length of exactly 1.0
.
* @return the new normalized Vector
* @since 1.0
*/
public Vector makeNormalizedVector() {
return null;
}
/**
* Calculate the angle between this
and a second
* Vector
.
* @param other the other Vector
* @return the angle (in radians)
* @since 1.0
*/
public double calcAngle(Vector other) {
return Double.NaN;
}
/**
* Build a String
representing this Vector
, as
* [x, y, z]
.
* @return the String [x, y, z]
* @since 1.0
*/
@Override
public String toString() {
return null;
}
/**
* Return true
if this
* Vector
is equivalent to another one; otherwise
* false.
* @param otherObject the other object (probably a Vector
) to
* compare with
* @return the whether they are equivalent
* @since 1.0
*/
@Override
public boolean equals(Object otherObject) {
return false;
}
/**
* Accessor for the x coordinate.
* @return the x coordinate
* @since 1.0
*/
public double getX() {
return Double.NaN;
}
/**
* Accessor for the y coordinate.
* @return the y coordinate
* @since 1.0
*/
public double getY() {
return Double.NaN;
}
/**
* Accessor for the z coordinate.
* @return the z coordinate
* @since 1.0
*/
public double getZ() {
return Double.NaN;
}
/**
* Mutator for the x coordinate.
* @param newX the new x coordinate
* @since 1.0
*/
public void setX(double newX) {
}
/**
* Mutator for the y coordinate.
* @param newY the new y coordinate
* @since 1.0
*/
public void setY(double newY) {
}
/**
* Mutator for the z coordinate.
* @param newZ the new z coordinate
* @since 1.0
*/
public void setZ(double newZ) {
}
}