Data structure for position in two dimensions.
More...
#include <JPosition2D.hh>
Data structure for position in two dimensions.
Definition at line 31 of file JPosition2D.hh.
◆ JPosition2D() [1/5]
JGEOMETRY2D::JPosition2D::JPosition2D |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 44 of file JPosition2D.hh.
JVector2D()
Default constructor.
◆ JPosition2D() [2/5]
JGEOMETRY2D::JPosition2D::JPosition2D |
( |
const JVector2D & |
pos | ) |
|
|
inline |
◆ JPosition2D() [3/5]
JGEOMETRY2D::JPosition2D::JPosition2D |
( |
const JAngle2D & |
angle | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 64 of file JPosition2D.hh.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
◆ JPosition2D() [4/5]
JGEOMETRY2D::JPosition2D::JPosition2D |
( |
const JVersor2D & |
dir | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 75 of file JPosition2D.hh.
double getDX() const
Get x direction.
double getDY() const
Get y direction.
◆ JPosition2D() [5/5]
JGEOMETRY2D::JPosition2D::JPosition2D |
( |
const double |
x, |
|
|
const double |
y |
|
) |
| |
|
inline |
◆ getPosition() [1/2]
const JPosition2D& JGEOMETRY2D::JPosition2D::getPosition |
( |
| ) |
const |
|
inline |
Get position.
- Returns
- position
Definition at line 98 of file JPosition2D.hh.
Data structure for position in two dimensions.
◆ getPosition() [2/2]
◆ setPosition()
void JGEOMETRY2D::JPosition2D::setPosition |
( |
const JVector2D & |
pos | ) |
|
|
inline |
Set position.
- Parameters
-
Definition at line 120 of file JPosition2D.hh.
Data structure for vector in two dimensions.
◆ operator JAngle2D()
JGEOMETRY2D::JPosition2D::operator JAngle2D |
( |
| ) |
const |
|
inline |
Type conversion operator.
- Returns
- angle
Definition at line 131 of file JPosition2D.hh.
Data structure for angle in two dimensions.
double getY() const
Get y position.
double getX() const
Get x position.
◆ operator JVersor2D()
JGEOMETRY2D::JPosition2D::operator JVersor2D |
( |
| ) |
const |
|
inline |
Type conversion operator.
- Returns
- direction
Definition at line 142 of file JPosition2D.hh.
Data structure for normalised vector in two dimensions.
◆ rotate()
Rotate.
- Parameters
-
- Returns
- this position
Definition at line 154 of file JPosition2D.hh.
void rotate(double &__x, double &__y) const
Rotate.
◆ rotate_back()
Rotate back.
- Parameters
-
- Returns
- this position
Definition at line 168 of file JPosition2D.hh.
void rotate_back(double &__x, double &__y) const
Rotate back.
◆ getDot() [1/4]
double JGEOMETRY2D::JPosition2D::getDot |
( |
const JAngle2D & |
angle | ) |
const |
|
inline |
Get dot product.
- Parameters
-
- Returns
- dot product
Definition at line 182 of file JPosition2D.hh.
◆ getDot() [2/4]
double JGEOMETRY2D::JPosition2D::getDot |
( |
const JVersor2D & |
versor | ) |
const |
|
inline |
Get dot product.
- Parameters
-
- Returns
- dot product
Definition at line 196 of file JPosition2D.hh.
◆ getPerpDot() [1/4]
double JGEOMETRY2D::JPosition2D::getPerpDot |
( |
const JAngle2D & |
angle | ) |
const |
|
inline |
Get perpendicular dot product.
- Parameters
-
- Returns
- perpendicular dot product
Definition at line 210 of file JPosition2D.hh.
◆ getPerpDot() [2/4]
double JGEOMETRY2D::JPosition2D::getPerpDot |
( |
const JVersor2D & |
dir | ) |
const |
|
inline |
Get perpendicular dot product.
- Parameters
-
- Returns
- perpendicular dot product
Definition at line 224 of file JPosition2D.hh.
◆ getDot() [3/4]
double JGEOMETRY2D::JVector2D::getDot |
|
inline |
Get dot product.
- Parameters
-
- Returns
- dot product
Definition at line 235 of file JVector2D.hh.
238 getX() * point.getX() +
239 getY() * point.getY();
◆ getPerpDot() [3/4]
double JGEOMETRY2D::JVector2D::getPerpDot |
|
inline |
Get perpendicular dot product.
- Parameters
-
- Returns
- perpendicular dot product
Definition at line 249 of file JVector2D.hh.
252 getX() * point.getY() -
253 getY() * point.getX();
◆ transform() [1/2]
Transform.
- Parameters
-
- Returns
- this vector
Definition at line 160 of file JVector2D.hh.
◆ getX()
double JGEOMETRY2D::JVector2D::getX |
( |
| ) |
const |
|
inlineinherited |
Get x position.
- Returns
- x position
Definition at line 63 of file JVector2D.hh.
◆ getY()
double JGEOMETRY2D::JVector2D::getY |
( |
| ) |
const |
|
inlineinherited |
Get y position.
- Returns
- y position
Definition at line 74 of file JVector2D.hh.
◆ negate()
JVector2D& JGEOMETRY2D::JVector2D::negate |
( |
| ) |
|
|
inlineinherited |
Negate vector.
- Returns
- this vector
Definition at line 85 of file JVector2D.hh.
◆ add()
Add vector.
- Parameters
-
- Returns
- this vector
Definition at line 100 of file JVector2D.hh.
◆ sub()
Subtract vector.
- Parameters
-
- Returns
- this vector
Definition at line 115 of file JVector2D.hh.
◆ mul() [1/2]
JVector2D& JGEOMETRY2D::JVector2D::mul |
( |
const double |
factor | ) |
|
|
inlineinherited |
Scale vector.
- Parameters
-
factor | multiplication factor |
- Returns
- this vector
Definition at line 130 of file JVector2D.hh.
◆ mul() [2/2]
template<class JFirst_t , class JSecond_t >
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul |
( |
const JSecond_t & |
object | ) |
|
|
inlineinherited |
Multiply with object.
- Parameters
-
- Returns
- result object
Definition at line 354 of file JMath.hh.
356 return static_cast<JFirst_t&
>(*this) = JFirst_t().mul(
static_cast<const JFirst_t&
>(*
this),
object);
◆ div()
JVector2D& JGEOMETRY2D::JVector2D::div |
( |
const double |
factor | ) |
|
|
inlineinherited |
Scale vector.
- Parameters
-
- Returns
- this vector
Definition at line 145 of file JVector2D.hh.
◆ transform() [2/2]
Transform.
- Parameters
-
- Returns
- this vector
Definition at line 160 of file JVector2D.hh.
◆ equals()
bool JGEOMETRY2D::JVector2D::equals |
( |
const JVector2D & |
vector, |
|
|
const double |
precision = std::numeric_limits<double>::min() |
|
) |
| const |
|
inlineinherited |
Check equality.
- Parameters
-
vector | vector |
precision | precision |
- Returns
- true if vectors are equal; else false
Definition at line 175 of file JVector2D.hh.
178 return (fabs(
getX() - vector.
getX()) <= precision &&
179 fabs(
getY() - vector.
getY()) <= precision);
◆ getLengthSquared()
double JGEOMETRY2D::JVector2D::getLengthSquared |
( |
| ) |
const |
|
inlineinherited |
Get length squared.
- Returns
- square of length
Definition at line 188 of file JVector2D.hh.
◆ getLength()
double JGEOMETRY2D::JVector2D::getLength |
( |
| ) |
const |
|
inlineinherited |
Get length.
- Returns
- length
Definition at line 199 of file JVector2D.hh.
double getLengthSquared() const
Get length squared.
◆ getDistanceSquared()
double JGEOMETRY2D::JVector2D::getDistanceSquared |
( |
const JVector2D & |
point | ) |
const |
|
inlineinherited |
Get squared of distance to point.
- Parameters
-
- Returns
- square of distance
Definition at line 211 of file JVector2D.hh.
213 return JVector2D(point).sub(*this).getLengthSquared();
◆ getDistance()
double JGEOMETRY2D::JVector2D::getDistance |
( |
const JVector2D & |
point | ) |
const |
|
inlineinherited |
Get distance to point.
- Parameters
-
- Returns
- distance
Definition at line 223 of file JVector2D.hh.
double getDistanceSquared(const JVector2D &point) const
Get squared of distance to point.
◆ getDot() [4/4]
double JGEOMETRY2D::JVector2D::getDot |
( |
const JVector2D & |
point | ) |
const |
|
inlineinherited |
Get dot product.
- Parameters
-
- Returns
- dot product
Definition at line 235 of file JVector2D.hh.
◆ getPerpDot() [4/4]
double JGEOMETRY2D::JVector2D::getPerpDot |
( |
const JVector2D & |
point | ) |
const |
|
inlineinherited |
Get perpendicular dot product.
- Parameters
-
- Returns
- perpendicular dot product
Definition at line 249 of file JVector2D.hh.
◆ operator>> [1/2]
std::istream& operator>> |
( |
std::istream & |
in, |
|
|
JPosition2D & |
position |
|
) |
| |
|
friend |
Read position from input.
- Parameters
-
in | input stream |
position | position |
- Returns
- input stream
Definition at line 239 of file JPosition2D.hh.
241 in >> position.
__x >> position.
__y;
◆ operator<< [1/2]
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const JPosition2D & |
position |
|
) |
| |
|
friend |
Write position to output.
- Parameters
-
out | output stream |
position | position |
- Returns
- output stream
Definition at line 254 of file JPosition2D.hh.
256 const JFormat format(out, getFormat<JPosition2D>(
JFormat_t(9, 3, std::ios::fixed | std::ios::showpos)));
258 out << format << position.
getX() <<
' '
259 << format << position.
getY();
◆ operator>> [2/2]
Read position from input.
- Parameters
-
in | reader |
position | position |
- Returns
- reader
Definition at line 272 of file JPosition2D.hh.
◆ operator<< [2/2]
Write position to output.
- Parameters
-
out | writer |
position | position |
- Returns
- writer
Definition at line 288 of file JPosition2D.hh.
◆ __x
double JGEOMETRY2D::JVector2D::__x |
|
protectedinherited |
◆ __y
double JGEOMETRY2D::JVector2D::__y |
|
protectedinherited |
The documentation for this class was generated from the following file: