Package org.robwork.sdurw
Class Vector2Dd
- java.lang.Object
-
- org.robwork.sdurw.Vector2Dd
-
public class Vector2Dd extends java.lang.Object
A 2D vector \mathbf{v}\in \mathbb{R}^2
\robabx{i}{j}{\mathbf{v}} = \left[ \begin{array}{c} v_x \\ v_y \end{array} \right]
In addition, Vector2D supports the cross product operator:
v3 = cross(v1, v2)
Usage example:
using namespace rw::math; Vector2Ddouble v1(1.0, 2.0); Vector2Ddouble v2(6.0, 7.0); Vector2Ddouble v3 = cross( v1, v2 ); Vector2Ddouble v4 = v2 - v1;
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
angle()
returns the counter clock-wise angle between
this vector and the x-axis vector (1,0).void
delete()
EigenVector2d
e()
Returns Eigen vector equivalent to *this.double
get(long i)
static long
getCPtr(Vector2Dd obj)
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.java.lang.String
toString()
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Vector2Dd obj)
-
delete
public void delete()
-
e
public EigenVector2d e()
Returns Eigen vector equivalent to *this.
-
size
public long size()
The dimension of the vector (i.e. 2).
This method is provided to help support generic algorithms using
size() and operator[].
-
angle
public double angle()
returns the counter clock-wise angle between
this vector and the x-axis vector (1,0). The angle
returned will be in the interval [-Pi,Pi]
-
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
-
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)
-
-