public class Vector
extends java.lang.Object
implements android.os.Parcelable
| Modifier and Type | Field and Description |
|---|---|
static android.os.Parcelable.Creator<Vector> |
CREATOR |
double |
x |
double |
y |
double |
z |
| Constructor and Description |
|---|
Vector() |
Vector(double x,
double y,
double z)
Constructs new vector in 3-dimensional space.
|
| Modifier and Type | Method and Description |
|---|---|
double |
abs()
Does
|
Vector |
add(Vector vector)
Adds another vector to this vector.
|
Vector |
crossProduct(Vector vector)
Computes the cross product of this vector an another.
|
int |
describeContents() |
double |
dotProduct(Vector vector)
Defines scalar product of this vector and another.
|
Vector |
multiply(double value)
Multiplies this vector by a given value.
|
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public double x
public double y
public double z
public static final android.os.Parcelable.Creator<Vector> CREATOR
public Vector(double x,
double y,
double z)
x - x coordinatey - y coordinatez - z coordinatepublic Vector()
public double abs()
public Vector multiply(double value)
value - value to multiply bypublic Vector add(Vector vector)
vector - vector to add.public double dotProduct(Vector vector)
vector - another vectorpublic Vector crossProduct(Vector vector)
vector - another vectorpublic java.lang.String toString()
toString in class java.lang.Objectpublic int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.Parcelable