Data structure for vector in three dimensions.
More...
#include <JVector3D.hh>
Data structure for vector in three dimensions.
This class implements the JMATH::JMath interface.
Definition at line 33 of file JVector3D.hh.
◆ JVector3D() [1/3]
JGEOMETRY3D::JVector3D::JVector3D |
( |
| ) |
|
|
inline |
◆ JVector3D() [2/3]
JGEOMETRY3D::JVector3D::JVector3D |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
x | x value |
y | y value |
z | z value |
Definition at line 54 of file JVector3D.hh.
◆ JVector3D() [3/3]
JGEOMETRY3D::JVector3D::JVector3D |
( |
const JVector2D & |
vector, |
|
|
const double |
z |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
vector | (x,y) values |
z | z value |
Definition at line 69 of file JVector3D.hh.
◆ operator JVector2D()
JGEOMETRY3D::JVector3D::operator JVector2D |
( |
| ) |
const |
|
inline |
Type conversion operator.
- Returns
- JVector2D
Definition at line 82 of file JVector3D.hh.
84 return JVector2D(this->
getX(), this->
getY());
◆ getX()
double JGEOMETRY3D::JVector3D::getX |
( |
| ) |
const |
|
inline |
Get x position.
- Returns
- x position
Definition at line 93 of file JVector3D.hh.
◆ getY()
double JGEOMETRY3D::JVector3D::getY |
( |
| ) |
const |
|
inline |
Get y position.
- Returns
- y position
Definition at line 103 of file JVector3D.hh.
◆ getZ()
double JGEOMETRY3D::JVector3D::getZ |
( |
| ) |
const |
|
inline |
Get z position.
- Returns
- z position
Definition at line 114 of file JVector3D.hh.
◆ negate()
JVector3D& JGEOMETRY3D::JVector3D::negate |
( |
| ) |
|
|
inline |
Negate vector.
- Returns
- this vector
Definition at line 125 of file JVector3D.hh.
◆ add()
Add vector.
- Parameters
-
- Returns
- this vector
Definition at line 141 of file JVector3D.hh.
◆ sub()
Subtract vector.
- Parameters
-
- Returns
- this vector
Definition at line 157 of file JVector3D.hh.
◆ mul() [1/2]
JVector3D& JGEOMETRY3D::JVector3D::mul |
( |
const double |
factor | ) |
|
|
inline |
Scale vector.
- Parameters
-
factor | multiplication factor |
- Returns
- this vector
Definition at line 173 of file JVector3D.hh.
◆ div()
JVector3D& JGEOMETRY3D::JVector3D::div |
( |
const double |
factor | ) |
|
|
inline |
Scale vector.
- Parameters
-
- Returns
- this vector
Definition at line 189 of file JVector3D.hh.
◆ transform()
Transform.
- Parameters
-
- Returns
- this vector
Definition at line 205 of file JVector3D.hh.
◆ equals()
bool JGEOMETRY3D::JVector3D::equals |
( |
const JVector3D & |
vector, |
|
|
const double |
precision = std::numeric_limits<double>::min() |
|
) |
| const |
|
inline |
Check equality.
- Parameters
-
- Returns
- true if vectors are equal; else false
Definition at line 219 of file JVector3D.hh.
222 return (fabs(
getX() - vector.
getX()) <= precision &&
223 fabs(
getY() - vector.
getY()) <= precision &&
224 fabs(
getZ() - vector.
getZ()) <= precision);
◆ getLengthSquared()
double JGEOMETRY3D::JVector3D::getLengthSquared |
( |
| ) |
const |
|
inline |
Get length squared.
- Returns
- square of length
Definition at line 233 of file JVector3D.hh.
◆ getLength()
double JGEOMETRY3D::JVector3D::getLength |
( |
| ) |
const |
|
inline |
◆ getDistanceSquared()
double JGEOMETRY3D::JVector3D::getDistanceSquared |
( |
const JVector3D & |
pos | ) |
const |
|
inline |
Get squared of distance to point.
- Parameters
-
- Returns
- square of distance
Definition at line 256 of file JVector3D.hh.
258 return JVector3D(pos).sub(*this).getLengthSquared();
◆ getDistance()
double JGEOMETRY3D::JVector3D::getDistance |
( |
const JVector3D & |
pos | ) |
const |
|
inline |
Get distance to point.
- Parameters
-
- Returns
- distance
Definition at line 268 of file JVector3D.hh.
◆ getDot()
double JGEOMETRY3D::JVector3D::getDot |
( |
const JVector3D & |
vector | ) |
const |
|
inline |
Get dot product.
- Parameters
-
- Returns
- dot product
Definition at line 280 of file JVector3D.hh.
◆ cross()
Get cross product.
Note that this vector should not overlap with the first or second vector,
- Parameters
-
first | first vector |
second | second vector |
- Returns
- this vector
Definition at line 297 of file JVector3D.hh.
◆ mul() [2/2]
Multiply with object.
- Parameters
-
- Returns
- result object
Definition at line 273 of file JMath.hh.
◆ __x
double JGEOMETRY3D::JVector3D::__x |
|
protected |
◆ __y
double JGEOMETRY3D::JVector3D::__y |
|
protected |
◆ __z
double JGEOMETRY3D::JVector3D::__z |
|
protected |
The documentation for this class was generated from the following file: