public class Vector
extends java.lang.Object
Constructor and Description |
---|
Vector() |
Vector(double[] data) |
Vector(double x,
double y) |
Vector(double x,
double y,
double z) |
Vector(double x,
double y,
double z,
double w) |
Vector(int size) |
Modifier and Type | Method and Description |
---|---|
Vector |
add(Vector other)
Vector sum.
|
Vector |
cross(Vector other)
Cross product.
|
double |
dot(Vector other)
Dot product.
|
double |
get(int index) |
double[] |
getData() |
int |
getSize() |
double |
getW()
W component.
|
double |
getX()
X component.
|
double |
getY()
Y component.
|
double |
getZ()
Z component.
|
Vector |
mul(double c)
Multiplication by scalar.
|
double |
norm()
Vector norm.
|
Vector |
normalized()
Normalized vector.
|
void |
set(int index,
double value) |
void |
setData(double[] data) |
void |
setW(double value)
W component.
|
void |
setX(double value)
X component.
|
void |
setY(double value)
Y component.
|
void |
setZ(double value)
Z component.
|
Vector |
sub(Vector other)
Vector difference.
|
public Vector()
public Vector(int size)
public Vector(double x, double y)
public Vector(double x, double y, double z)
public Vector(double x, double y, double z, double w)
public Vector(double[] data)
public int getSize()
public double get(int index)
public void set(int index, double value)
public double getX()
public double getY()
public double getZ()
public double getW()
public void setX(double value)
public void setY(double value)
public void setZ(double value)
public void setW(double value)
public double[] getData()
public void setData(double[] data)
public double dot(Vector other)
public Vector mul(double c)
public double norm()
public Vector normalized()