public class Vector extends Object
| Constructor and Description |
|---|
Vector(float[] elementArray) |
Vector(int size) |
| Modifier and Type | Method and Description |
|---|---|
Vector |
add(Vector other) |
Vector |
addToSelf(Vector other) |
float |
cosine(Vector other)
夹角的余弦
|
float |
cosineForUnitVector(Vector other)
夹角的余弦
认为this和other都是单位向量,所以方法内部没有除以两者的模。 |
Vector |
divideToSelf(float f) |
Vector |
divideToSelf(int n) |
float |
dot(Vector other) |
float[] |
getElementArray() |
Vector |
minus(Vector other) |
float |
norm() |
Vector |
normalize()
自身归一化
|
void |
setElementArray(float[] elementArray) |
int |
size() |
public int size()
public float dot(Vector other)
public float norm()
public float cosineForUnitVector(Vector other)
other - public float cosine(Vector other)
other - public Vector divideToSelf(int n)
public Vector divideToSelf(float f)
public Vector normalize()
public float[] getElementArray()
public void setElementArray(float[] elementArray)
Copyright © 2014–2021 码农场. All rights reserved.