LibreCAD
|
#include <geocoordinate.h>
Public Member Functions | |
Coordinate () | |
Coordinate (double x, double y, double z) | |
Coordinate (double x, double y) | |
Coordinate (double angle) | |
Coordinate (Coordinate &&c) noexcept | |
Coordinate (const Coordinate &c) | |
double | x () const |
Returns x of Coordinate. More... | |
double | y () const |
Returns y of Coordinate. More... | |
double | z () const |
Returns z of Coordinate. More... | |
Coordinate & | operator= (const Coordinate &coord) |
Coordinate | flipXY () const |
flips the x and y of Coordinate More... | |
double | angleTo (const Coordinate &v) const |
Returns angle To the coordinate. More... | |
double | angleBetween (const Coordinate &v1, const Coordinate &v2) const |
bool | operator== (const Coordinate &coord) const |
checks for the equality of Coordinate More... | |
bool | operator!= (const Coordinate &coord) const |
double | distanceTo (const geo::Coordinate &c) const |
Coordinate | operator+ (const Coordinate &coord) const |
Coordinate | operator+ (double d) const |
operator + for offset addition More... | |
Coordinate | operator- (double d) const |
operator + for offset addition More... | |
Coordinate | operator- () const |
operator - More... | |
Coordinate | operator- (const Coordinate &coord) const |
Coordinate | operator* (const Coordinate &coord) const |
Coordinate | operator* (double s) const |
Coordinate | operator/ (double s) const |
double | magnitude () const |
double | angle () const |
double | squared () const |
double | dot (const Coordinate &coord) const |
double | dot (const Coordinate &v1, const Coordinate &v2) const |
Coordinate | rotate (const Coordinate &angleVector) const |
rotate around (0.,0.) with a given angle vector More... | |
Coordinate | rotate (const double &angle) const |
rotate around (0.,0.) with a given angle More... | |
Coordinate | rotate (const geo::Coordinate &point, const Coordinate &angleVector) const |
rotate around a point with a angle vector More... | |
Coordinate | rotate (const geo::Coordinate &point, const double &angle) const |
rotate around a point with a angle More... | |
Coordinate | rotateByArcLength (const geo::Coordinate &point, double const length) const |
rotate around a point where the rotation described length is known Example More... | |
Coordinate | scale (const double &scale_factor) const |
Coordinate | scale (const Coordinate &scale_factor) const |
Coordinate | scale (const Coordinate &scale_center, const Coordinate &scale_factor) const |
Coordinate | mid (const Coordinate &other) const |
Coordinate | norm () const |
Coordinate | norm (const double f) const |
Coordinate | move (const Coordinate &direction, double d) const |
Coordinate | moveTo (const Coordinate &to, double d) const |
Coordinate | transform2d (double xx, double yx, double xy, double yy, double x0, double y0) |
Coordinate | mirror (const Coordinate &axis1, const Coordinate &axis2) const |
mirror a coordinate More... | |
Private Attributes | |
double | _x |
double | _y |
double | _z |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Coordinate &coordinate) |
Class that represents a coordinate in space
Definition at line 12 of file geocoordinate.h.
|
inlineexplicit |
Definition at line 14 of file geocoordinate.h.
|
inline |
Definition at line 15 of file geocoordinate.h.
|
inline |
Definition at line 16 of file geocoordinate.h.
|
inlineexplicit |
Definition at line 17 of file geocoordinate.h.
|
inlinenoexcept |
Definition at line 18 of file geocoordinate.h.
|
inline |
Definition at line 19 of file geocoordinate.h.
|
inline |
Definition at line 183 of file geocoordinate.h.
double Coordinate::angleBetween | ( | const Coordinate & | v1, |
const Coordinate & | v2 | ||
) | const |
Definition at line 7 of file geocoordinate.cpp.
|
inline |
Returns angle To the coordinate.
geo::Coordinate | v |
Definition at line 77 of file geocoordinate.h.
|
inline |
Calculate the distance between this coordinate and another coordinate
Definition at line 104 of file geocoordinate.h.
|
inline |
Dot product with other coordindate : return _x * coord._x + _y * coord._y + _z * coord._z;
Coordinate |
Definition at line 203 of file geocoordinate.h.
|
inline |
Definition at line 207 of file geocoordinate.h.
|
inline |
flips the x and y of Coordinate
Definition at line 68 of file geocoordinate.h.
|
inline |
Magnitude or length of the point relative to zero : return sqrtf(_x * _x + _y * _y + _z * _z)
Definition at line 179 of file geocoordinate.h.
|
inline |
Midpoint between two coordinates
Definition at line 292 of file geocoordinate.h.
|
inline |
mirror a coordinate
axis1 | : First point of line to be mirrored about |
axis2 | : Second point of line to be mirrored about |
Definition at line 342 of file geocoordinate.h.
|
inline |
move the coordinate by distance d over vector direction
Definition at line 315 of file geocoordinate.h.
|
inline |
Move the coordinate in the direction of point 'to' with distance d
Definition at line 322 of file geocoordinate.h.
|
inline |
|
inline |
Normalised version of this coordinate with a factor The final Coordinate has a length of f
Definition at line 307 of file geocoordinate.h.
|
inline |
Definition at line 96 of file geocoordinate.h.
|
inline |
Multiplication by Coordinate : return Coordinate(_x * s, _y * s, _z * s)
Coordinate |
Definition at line 157 of file geocoordinate.h.
|
inline |
Definition at line 161 of file geocoordinate.h.
|
inline |
Add two points to each other and return a new coordinate : return Coordinate(_x + coord._x, _y + coord._y, _z + coord._z);
Definition at line 112 of file geocoordinate.h.
|
inline |
operator + for offset addition
double | offset |
Definition at line 121 of file geocoordinate.h.
|
inline |
operator + for offset addition
double | offset |
Definition at line 130 of file geocoordinate.h.
|
inline |
|
inline |
Substract two points from each other and return a new coordinate : return _x - coord._x, _y - coord._y, _z - coord._z returns Coordinate
Definition at line 147 of file geocoordinate.h.
|
inline |
Division by double : return Coordinate(_x / s, _y / s, _z / s)
double |
Definition at line 170 of file geocoordinate.h.
|
inline |
Definition at line 47 of file geocoordinate.h.
|
inline |
checks for the equality of Coordinate
geo::coordinate |
Definition at line 92 of file geocoordinate.h.
|
inline |
rotate around (0.,0.) with a given angle vector
angleVector |
Definition at line 217 of file geocoordinate.h.
|
inline |
rotate around (0.,0.) with a given angle
angle |
Definition at line 229 of file geocoordinate.h.
|
inline |
rotate around a point with a angle vector
point | |
angleVector |
Definition at line 240 of file geocoordinate.h.
|
inline |
rotate around a point with a angle
point | |
angle |
Definition at line 251 of file geocoordinate.h.
|
inline |
rotate around a point where the rotation described length is known Example
point | |
length |
Definition at line 263 of file geocoordinate.h.
|
inline |
Scales the vector by given factors with 0/0 as center
Definition at line 271 of file geocoordinate.h.
|
inline |
Scales the vector by given factors with 0/0 as center
Definition at line 278 of file geocoordinate.h.
|
inline |
Scales this vector by the given factors with the given center.
Definition at line 285 of file geocoordinate.h.
|
inline |
Squared of this Coordinate : return _x * _x + _y * _y + _z * _z;
Definition at line 193 of file geocoordinate.h.
|
inline |
Apply transformation matrix to coordinates in X/Y only Note: this is a very naive approach to transform if we see ourselves using this function on large vectors of coordinates we should consider using Eigen
Definition at line 332 of file geocoordinate.h.
|
inline |
|
inline |
|
inline |
|
friend |
Definition at line 350 of file geocoordinate.h.
|
private |
Definition at line 356 of file geocoordinate.h.
|
private |
Definition at line 357 of file geocoordinate.h.
|
private |
Definition at line 358 of file geocoordinate.h.