OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Math.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTCore/Point2D.h"
11
12namespace ot {
13
15 public:
16
22 static double euclideanDistance(double _x1, double _y1, double _x2, double _y2);
23
25 static double euclideanDistance(const Point2DD& _p1, const Point2DD& _p2) { return Math::euclideanDistance(_p1.x(), _p1.y(), _p2.x(), _p2.y()); };
26
34 static double calculateShortestDistanceFromPointToLine(double _px, double _py, double _x1, double _y1, double _x2, double _y2);
35
37 static double calculateShortestDistanceFromPointToLine(const Point2DD& _pt, const Point2DD& _lineStart, const Point2DD& _lineEnd) { return Math::calculateShortestDistanceFromPointToLine(_pt.x(), _pt.y(), _lineStart.x(), _lineStart.y(), _lineEnd.x(), _lineEnd.y()); };
38
49 static Point2DD calculatePointOnBezierCurve(double _t, double _startX, double _startY, double _control1X, double _control1Y, double _control2X, double _control2Y, double _endX, double _endY);
50
52 static Point2DD calculatePointOnBezierCurve(double _t, const Point2DD& _start, const Point2DD& _control1, const Point2DD& _control2, const Point2DD& _end) { return Math::calculatePointOnBezierCurve(_t, _start.x(), _start.y(), _control1.x(), _control1.y(), _control2.x(), _control2.y(), _end.x(), _end.y()); };
53
65 static double calculateShortestDistanceFromPointToBezierCurve(double _px, double _py, double _startX, double _startY, double _control1X, double _control1Y, double _control2X, double _control2Y, double _endX, double _endY);
66
68 static double calculateShortestDistanceFromPointToBezierCurve(const Point2DD& _pt, const Point2DD& _start, const Point2DD& _control1, const Point2DD& _control2, const Point2DD& _end) { return Math::calculateShortestDistanceFromPointToBezierCurve(_pt.x(), _pt.y(), _start.x(), _start.y(), _control1.x(), _control1.y(), _control2.x(), _control2.y(), _end.x(), _end.y()); };
69 };
70
71}
#define OT_CORE_API_EXPORT
Dll import.
Definition CoreAPIExport.h:8
Definition Math.h:14
static double calculateShortestDistanceFromPointToLine(const Point2DD &_pt, const Point2DD &_lineStart, const Point2DD &_lineEnd)
Definition Math.h:37
static Point2DD calculatePointOnBezierCurve(double _t, const Point2DD &_start, const Point2DD &_control1, const Point2DD &_control2, const Point2DD &_end)
Definition Math.h:52
static double calculateShortestDistanceFromPointToBezierCurve(const Point2DD &_pt, const Point2DD &_start, const Point2DD &_control1, const Point2DD &_control2, const Point2DD &_end)
Definition Math.h:68
static double euclideanDistance(const Point2DD &_p1, const Point2DD &_p2)
Definition Math.h:25
2D Point with double values
Definition Point2D.h:144
double y(void) const
Returns the current Y value.
Definition Point2D.h:174
double x(void) const
Returns the current X value.
Definition Point2D.h:171
Definition Connector.h:8