Vector1D.Sum, Vector1D.Unit
Modifier and Type | Field and Description |
---|---|
static Vector1D.Unit |
MINUS
Negation of unit vector (coordinates: -1).
|
static Vector1D.Unit |
PLUS
Unit vector (coordinates: 1).
|
COORDINATE_ASCENDING_ORDER, NaN, NEGATIVE_INFINITY, POSITIVE_INFINITY, ZERO
Modifier and Type | Method and Description |
---|---|
static Vector1D.Unit |
from(double x)
Create a normalized vector.
|
static Vector1D.Unit |
from(Vector1D v)
Create a normalized vector.
|
Vector1D |
negate() |
double |
norm() |
Vector1D.Unit |
normalize() |
Vector1D.Unit |
normalizeOrNull() |
double |
normSq() |
Vector1D |
withNorm(double mag) |
add, add, angle, directionTo, distance, distanceSq, dot, eq, equals, getDimension, getX, getZero, hashCode, isFinite, isInfinite, isNaN, lerp, multiply, of, parse, subtract, subtract, toString, transform, vectorTo
getCheckedNorm, isZero
public static final Vector1D.Unit PLUS
public static final Vector1D.Unit MINUS
public double norm()
public double normSq()
public Vector1D.Unit normalize()
public Vector1D.Unit normalizeOrNull()
normalizeOrNull
in interface Vector<Vector1D>
normalizeOrNull
in class Vector1D
public static Vector1D.Unit from(double x)
x
- Vector coordinate.IllegalArgumentException
- if the norm of the given value is zero, NaN, or infinitepublic static Vector1D.Unit from(Vector1D v)
v
- Vector.IllegalArgumentException
- if the norm of the given value is zero, NaN, or infiniteCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.