Package org.robwork.sdurw
Class Vector3Df
- java.lang.Object
-
- org.robwork.sdurw.Vector3Df
-
public class Vector3Df extends java.lang.Object
A 3D vector \mathbf{v}\in \mathbb{R}^3
\robabx{i}{j}{\mathbf{v}} = \left[ \begin{array}{c} v_x \\ v_y \\ v_z \end{array} \right]
Usage example:
const Vector3Ddouble v1(1.0, 2.0, 3.0); const Vector3Ddouble v2(6.0, 7.0, 8.0); const Vector3Ddouble v3 = cross(v1, v2); const double d = dot(v1, v2); const Vector3Ddouble v4 = v2 - v1;
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector3Df
add(Vector3Df other)
Vector addition.void
delete()
Vector3Df
divide(float s)
Scalar division.EigenVector3f
e()
Returns Eigen vector with the values of *thisboolean
equals(Vector3Df q)
Compare with b for equality.
float
get(long i)
static long
getCPtr(Vector3Df obj)
Vector3Df
multiply(float scale)
Scalar multiplication.Vector3Df
negate()
Unary minus.float
norm1()
Returns the Manhatten norm (1-norm) of the vectorfloat
norm2()
Returns the Euclidean norm (2-norm) of the vectorfloat
normInf()
Returns the infinte norm ( \inf -norm) of the vectorvoid
set(long i, float d)
long
size()
The dimension of the vector (i.e.Vector3Df
subtract(Vector3Df other)
Vector subtraction.java.lang.String
toString()
static Vector3Df
x()
Get x vector (1,0,0)static Vector3Df
y()
Get y vector (0,1,0)static Vector3Df
z()
Get z vector (0,0,1)static Vector3Df
zero()
Get zero vector.
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Vector3Df obj)
-
delete
public void delete()
-
e
public EigenVector3f e()
Returns Eigen vector with the values of *this
-
size
public long size()
The dimension of the vector (i.e. 3).
This method is provided to help support generic algorithms using
size() and operator[].
-
divide
public Vector3Df divide(float s)
Scalar division.
-
multiply
public Vector3Df multiply(float scale)
Scalar multiplication.
-
negate
public Vector3Df negate()
Unary minus.
-
equals
public boolean equals(Vector3Df q)
Compare with b for equality.
- Returns:
- True if a equals b, false otherwise.
-
norm2
public float norm2()
Returns the Euclidean norm (2-norm) of the vector- Returns:
- the norm
-
norm1
public float norm1()
Returns the Manhatten norm (1-norm) of the vector- Returns:
- the norm
-
normInf
public float normInf()
Returns the infinte norm ( \inf -norm) of the vector- Returns:
- the norm
-
zero
public static Vector3Df zero()
Get zero vector.- Returns:
- vector.
-
x
public static Vector3Df x()
Get x vector (1,0,0)- Returns:
- vector.
-
y
public static Vector3Df y()
Get y vector (0,1,0)- Returns:
- vector.
-
z
public static Vector3Df z()
Get z vector (0,0,1)- Returns:
- vector.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
get
public float get(long i)
-
set
public void set(long i, float d)
-
-