Package org.robwork.sdurw
Class Vector3Dd
- java.lang.Object
-
- org.robwork.sdurw.Vector3Dd
-
public class Vector3Dd 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 Vector3Dd
add(Vector3Dd other)
Vector addition.void
delete()
Vector3Dd
divide(double s)
Scalar division.EigenVector3d
e()
Returns Eigen vector with the values of *thisboolean
equals(Vector3Dd q)
Compare with b for equality.
double
get(long i)
static long
getCPtr(Vector3Dd obj)
Vector3Dd
multiply(double scale)
Scalar multiplication.Vector3Dd
negate()
Unary minus.double
norm1()
Returns the Manhatten norm (1-norm) of the vectordouble
norm2()
Returns the Euclidean norm (2-norm) of the vectordouble
normInf()
Returns the infinte norm ( \inf -norm) of the vectorvoid
set(long i, double d)
long
size()
The dimension of the vector (i.e.Vector3Dd
subtract(Vector3Dd other)
Vector subtraction.java.lang.String
toString()
static Vector3Dd
x()
Get x vector (1,0,0)static Vector3Dd
y()
Get y vector (0,1,0)static Vector3Dd
z()
Get z vector (0,0,1)static Vector3Dd
zero()
Get zero vector.
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Vector3Dd obj)
-
delete
public void delete()
-
e
public EigenVector3d 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 Vector3Dd divide(double s)
Scalar division.
-
multiply
public Vector3Dd multiply(double scale)
Scalar multiplication.
-
negate
public Vector3Dd negate()
Unary minus.
-
equals
public boolean equals(Vector3Dd q)
Compare with b for equality.
- Returns:
- True if a equals b, false otherwise.
-
norm2
public double norm2()
Returns the Euclidean norm (2-norm) of the vector- Returns:
- the norm
-
norm1
public double norm1()
Returns the Manhatten norm (1-norm) of the vector- Returns:
- the norm
-
normInf
public double normInf()
Returns the infinte norm ( \inf -norm) of the vector- Returns:
- the norm
-
zero
public static Vector3Dd zero()
Get zero vector.- Returns:
- vector.
-
x
public static Vector3Dd x()
Get x vector (1,0,0)- Returns:
- vector.
-
y
public static Vector3Dd y()
Get y vector (0,1,0)- Returns:
- vector.
-
z
public static Vector3Dd z()
Get z vector (0,0,1)- Returns:
- vector.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
get
public double get(long i)
-
set
public void set(long i, double d)
-
-