public class Vector extends Coordinate implements Comparable<Vector>
Coordinate for further informations.x| Constructor and Description |
|---|
Vector(float... v) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(float... v)
add
|
void |
add(Vector v)
add
|
static Vector |
add(Vector v1,
Vector... vv)
add
|
float |
angle(Vector v)
through the scalar product it is possible to calculate the angle between two vectors.
|
int |
compareTo(Vector o) |
static Vector |
create(int dim,
float defaultValue)
create
|
float |
distance(float... v)
distance as scalar.
|
Vector |
distance(Vector v2)
distance between this and v2. see
subtract(Vector, Vector...). |
static Vector |
e(int dim,
int row)
creates an n-dim normalized vector with number 1 on given row.
|
static List<Vector> |
fromStream(InputStream stream) |
static Vector |
invert(Vector v)
invert given vector
|
protected static int |
isEVector(Vector v)
isEVector
|
float |
len()
length of current vector
|
void |
multiply(float[]... m)
multiply with an equal-dim matrix
|
float |
multiply(Vector v)
delegates to
scalar(float...) |
void |
multiply(Vector[] m)
multiply with an equal-dim matrix
|
void |
normalize()
normalize vector
|
static Vector |
normalize(Vector v)
normalize the given vector
|
void |
orthogonizeInPlaneWith(Vector v2)
orthogonizeInPlaneWith
|
protected float |
scalar(float... v)
scalar / inner / dot product
|
float |
scalar(Vector v)
see
scalar(float...) |
static Vector |
scale(Vector v,
float f)
scale
|
protected void |
subtract(float... v)
subtract
|
void |
subtract(Vector v)
subtract
|
static Vector |
subtract(Vector v1,
Vector... vv)
subtract
|
static InputStream |
toStream(List<Vector> vl) |
checkDimension, checkDimension, clone, dimension, equals, hashCode, scale, scale, set, set, toStringpublic static Vector create(int dim, float defaultValue)
dim - dimensiondefaultValue - default value for each cellpublic static Vector scale(Vector v, float f)
v - vector to be scaledf - scale factorpublic void add(Vector v)
v - vector to addpublic static Vector add(Vector v1, Vector... vv)
v1 - source vector to add the vectors vv to.vv - adding vectorspublic void add(float... v)
add in class Coordinatev - coordinate to addpublic static Vector subtract(Vector v1, Vector... vv)
v1 - source vector to subtract the vectors vv from.vv - subtractions vectorsprotected void subtract(float... v)
v - vector to subtractpublic void subtract(Vector v)
v - vector to subtractpublic float scalar(Vector v)
scalar(float...)protected float scalar(float... v)
v - second operand of scalarpublic float multiply(Vector v)
scalar(float...)public float angle(Vector v)
v - another vector to calc the inner angle topublic void multiply(float[]... m)
m - matrixpublic void multiply(Vector[] m)
m - matrixpublic float len()
public Vector distance(Vector v2)
subtract(Vector, Vector...).v2 - second operandpublic float distance(float... v)
v - second operandpublic static Vector normalize(Vector v)
v - vector to normalizepublic void normalize()
public void orthogonizeInPlaneWith(Vector v2)
v2 - second operand in plane with current vector.protected static int isEVector(Vector v)
public static Vector e(int dim, int row)
dim - dimensionrow - coordinate position of 1.public static Vector invert(Vector v)
v - vector to invertpublic int compareTo(Vector o)
compareTo in interface Comparable<Vector>public static List<Vector> fromStream(InputStream stream)
public static InputStream toStream(List<Vector> vl)
Copyright © 2012–2020. All rights reserved.